Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
3efaa268db | |||
|
ea01cb0602 | ||
|
5be70267cb | ||
|
43cee04527 | ||
|
7057324fc0 | ||
|
07035125e6 | ||
|
53f757e13e |
11 changed files with 62 additions and 110 deletions
|
@ -1,25 +0,0 @@
|
||||||
pipeline:
|
|
||||||
build:
|
|
||||||
image: registry.nulo.in/sutty/haini.sh:latest
|
|
||||||
commands:
|
|
||||||
- rm assets/js/*
|
|
||||||
- make yarn hainish="sh -c"
|
|
||||||
- make webpack hainish="sh -c"
|
|
||||||
commit:
|
|
||||||
image: registry.nulo.in/sutty/haini.sh:latest
|
|
||||||
commands:
|
|
||||||
- mkdir ~/.ssh/
|
|
||||||
- eval $(ssh-agent -s)
|
|
||||||
- echo "$${GIT_BASE64_SSH_KEY}" | base64 -d | ssh-add -
|
|
||||||
- echo [nulo.in]:420 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCPfptutxU1zs6ATFn/kkqLrsXzsJRMNxrPd9hfsccE2TAPnbLtcqFydioyx5ww+dacFFQ8xb481yYuFMof24XwsNQG0tGmrGNm321ewt4fHihfu8cvzE0WPcfgGGg8YETLvkkFNVC9p3JOeC1+X9YU/QHaSv7NQ9AmEYxYUD/qeZRAsm9NtbmwDxLUQixD6AMMLVKiUGFRIbdrDkCrQgqCb+0d06vG1DyPzhOhD+MyRwKAqizBE0KmqOYaNmCBkHqopphny0wMpqpWVO2OQCNeTCWmqzVvDvxOFS5ToMbueModINZuV9jGmsXz9FO3F0TinejxPBENgBJ1MPTEgoV4M8XqCfqw0yLvpB676fjHvxqdTfZqICcv26GBYbVY0DcGXR2dM2Un4uNfx30Ml22DDlpCBPkEILvZc9zMO3nm0XK8/yJCF17oitZu0a+j32MjOovvtvdVuwxe0KdoUaFa833a+hO/UKMycwCk8HARoIO6YPakcsqy7a+FTOVgWNY6cRMjJ8trUR1Fwi1kYo1o+VkRnU/l62xPr+BTleueZQnlXh1OGYpMwiwbcPYoqxr2CQp3rohmcypgWkMJESIrPnKPDJaQuCYruqOVmU5nJW5FJ3HIUgf1TiRyp+LXbSdXvKt3mnpV4aQkG9GSKzNl19Dx3AYQyUPImfekFLrpfw== > ~/.ssh/known_hosts
|
|
||||||
- echo [nulo.in]:420 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGPkgRVWYcVcgjI0xAjDgZQsYuXU9edcya8zna01ibyUMlfKHIMD9yOoq0R+fQPTCqwiol/2tKMPJ2hlKshc+H8= >> ~/.ssh/known_hosts
|
|
||||||
- echo [nulo.in]:420 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHgHIbf5/jkeyLMndnWlEO12DPj41YPqkmz+aIreVOsP >> ~/.ssh/known_hosts
|
|
||||||
- git checkout ${DRONE_BRANCH} # Tenemos que hacer esto porque Woodpecker solo `git reset` ea el commit que quiere.
|
|
||||||
- git config user.name Woodpecker
|
|
||||||
- git config user.email ci@nulo.in
|
|
||||||
- git add assets/js/* _data/assets.json
|
|
||||||
- git commit -m "[skip ci] Recompilar JS"
|
|
||||||
- git remote add nulo ssh://_gitea@nulo.in:420/Sutty/sutty-base-jekyll-theme.git
|
|
||||||
- git push -u nulo ${DRONE_BRANCH}
|
|
||||||
secrets:
|
|
||||||
- git_base64_ssh_key
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"assets/js/pack.js": "assets/js/pack.d2c9fc926fed547c03f8.js",
|
"assets/js/pack.js": "assets/js/pack.c42a6f683b2c0c0fa404.js",
|
||||||
"assets/js/pack.js.map": "assets/js/pack.d2c9fc926fed547c03f8.js.map"
|
"assets/js/pack.js.map": "assets/js/pack.c42a6f683b2c0c0fa404.js.map"
|
||||||
}
|
}
|
|
@ -1,4 +1,17 @@
|
||||||
<input type="checkbox" id="share" class="toggler" autocomplete="off" />
|
{%- assign title = include.title | escape -%}
|
||||||
|
{%- assign text = include.description | strip_html | escape -%}
|
||||||
|
{%- assign url = site.url | append: include.url | escape -%}
|
||||||
|
|
||||||
|
<input
|
||||||
|
data-controller="share"
|
||||||
|
data-action="share#share"
|
||||||
|
data-share-title-value="{{ title }}"
|
||||||
|
data-share-text-value="{{ text }}"
|
||||||
|
data-share-url-value="{{ url }}"
|
||||||
|
type="checkbox"
|
||||||
|
id="share"
|
||||||
|
class="toggler"
|
||||||
|
autocomplete="off" />
|
||||||
|
|
||||||
<label class="share btn border btn-block" for="share">
|
<label class="share btn border btn-block" for="share">
|
||||||
{{ site.i18n.share.text }}
|
{{ site.i18n.share.text }}
|
||||||
|
|
27
_packs/controllers/share_controller.js
Normal file
27
_packs/controllers/share_controller.js
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
import { Controller } from 'stimulus'
|
||||||
|
|
||||||
|
export default class extends Controller {
|
||||||
|
static values = {
|
||||||
|
title: String,
|
||||||
|
text: String,
|
||||||
|
url: String
|
||||||
|
}
|
||||||
|
|
||||||
|
async share (event = undefined) {
|
||||||
|
event?.preventDefault()
|
||||||
|
event?.stopPropagation()
|
||||||
|
|
||||||
|
const title = this.titleValue
|
||||||
|
const text = this.textValue
|
||||||
|
const url = this.urlValue
|
||||||
|
const data = { title, text, url }
|
||||||
|
|
||||||
|
if ('share' in navigator) {
|
||||||
|
if (navigator.canShare(data)) {
|
||||||
|
navigator.share(data)
|
||||||
|
} else {
|
||||||
|
console.error('No se puede compartir', data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,8 +9,14 @@ window.airbrake = new Notifier({
|
||||||
import 'core-js/stable'
|
import 'core-js/stable'
|
||||||
import 'regenerator-runtime/runtime'
|
import 'regenerator-runtime/runtime'
|
||||||
|
|
||||||
const Turbolinks = require("turbolinks")
|
// Turbo acelera la navegación al no tener que recargar todo el JS y CSS
|
||||||
Turbolinks.start()
|
// de la página, con lo que se siente más rápida y "nativa".
|
||||||
|
//
|
||||||
|
// Cambiamos de turbolinks a turbo porque turbo soporta la función
|
||||||
|
// fetch(), que luego es interceptada por el SW para obtener las
|
||||||
|
// direcciones localmente.
|
||||||
|
import * as Turbo from "@hotwired/turbo"
|
||||||
|
Turbo.start()
|
||||||
|
|
||||||
import { Application } from 'stimulus'
|
import { Application } from 'stimulus'
|
||||||
import { definitionsFromContext } from "stimulus/webpack-helpers"
|
import { definitionsFromContext } from "stimulus/webpack-helpers"
|
||||||
|
@ -19,33 +25,17 @@ const application = Application.start()
|
||||||
const context = require.context("./controllers", true, /\.js$/)
|
const context = require.context("./controllers", true, /\.js$/)
|
||||||
application.load(definitionsFromContext(context))
|
application.load(definitionsFromContext(context))
|
||||||
|
|
||||||
// Prevenir que Turbolinks interfiera con la navegación por anchors
|
|
||||||
// https://github.com/turbolinks/turbolinks/issues/75#issuecomment-445325162
|
|
||||||
document.addEventListener('turbolinks:click', event => {
|
|
||||||
const anchorElement = event.target
|
|
||||||
const isSamePageAnchor = (
|
|
||||||
anchorElement.hash &&
|
|
||||||
anchorElement.origin === window.location.origin &&
|
|
||||||
anchorElement.pathname === window.location.pathname
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!isSamePageAnchor) return
|
|
||||||
|
|
||||||
Turbolinks.controller.pushHistoryWithLocationAndRestorationIdentifier(event.data.url, Turbolinks.uuid())
|
|
||||||
|
|
||||||
event.preventDefault()
|
|
||||||
})
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
window.axe = require('axe-core/axe')
|
window.axe = require('axe-core/axe')
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
if (window.axe) window.axe.configure({ locale: require('axe-core/locales/es.json') })
|
if (window.axe) window.axe.configure({ locale: require('axe-core/locales/es.json') })
|
||||||
|
|
||||||
// Prevenir que Turbolinks interfiera la navegación a un anchor al
|
document.addEventListener('turbo:load', event => {
|
||||||
// recargar la página
|
document.querySelectorAll("a[href^='http://'],a[href^='https://'],a[href^='//']").forEach(a => {
|
||||||
document.addEventListener('turbolinks:load', event => {
|
a.rel = "noopener"
|
||||||
window.location.hash = window.location.hash
|
a.target = "_blank"
|
||||||
|
})
|
||||||
|
|
||||||
if (!window.axe) return
|
if (!window.axe) return
|
||||||
|
|
||||||
|
|
|
@ -118,9 +118,6 @@ $label-margin-bottom: 0;
|
||||||
@import "editor";
|
@import "editor";
|
||||||
@import "menu";
|
@import "menu";
|
||||||
|
|
||||||
/// La barra de progreso de Turbolinks tiene el color primario
|
|
||||||
/// de la paleta, definido por Bootstrap o por nosotres.
|
|
||||||
.turbolinks-progress-bar { background-color: $primary; }
|
|
||||||
/// La barra de progreso de Turbo tiene el color primario
|
/// La barra de progreso de Turbo tiene el color primario
|
||||||
/// de la paleta, definido por Bootstrap o por nosotres.
|
/// de la paleta, definido por Bootstrap o por nosotres.
|
||||||
.turbo-progress-bar { background-color: $primary; }
|
.turbo-progress-bar { background-color: $primary; }
|
||||||
|
|
BIN
assets/js/pack.d2c9fc926fed547c03f8.js
(Stored with Git LFS)
BIN
assets/js/pack.d2c9fc926fed547c03f8.js
(Stored with Git LFS)
Binary file not shown.
BIN
assets/js/pack.d2c9fc926fed547c03f8.js.map
(Stored with Git LFS)
BIN
assets/js/pack.d2c9fc926fed547c03f8.js.map
(Stored with Git LFS)
Binary file not shown.
|
@ -1,44 +0,0 @@
|
||||||
---
|
|
||||||
---
|
|
||||||
|
|
||||||
const loadEvent = () => {
|
|
||||||
try {
|
|
||||||
if (Turbolinks) return 'turbolinks:load'
|
|
||||||
} catch {
|
|
||||||
return 'DOMContentLoaded'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener(loadEvent(), () => {
|
|
||||||
document.querySelectorAll('.share').forEach(share => {
|
|
||||||
share.addEventListener('click', event => {
|
|
||||||
if (!Navigator.share) return;
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
const title = document.querySelector('title').text;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const text = document.querySelector('meta[property="og:description"]').content;
|
|
||||||
} catch {
|
|
||||||
const text = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const url = document.querySelector('link[rel=canonical]').href;
|
|
||||||
} catch {
|
|
||||||
const url = document.location.href;
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = { title: title, text: text, url: url };
|
|
||||||
|
|
||||||
if (Navigator.canShare(data)) Navigator.share(data).then();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
document.querySelectorAll("a[href^='http://'],a[href^='https://'],a[href^='//']").forEach(a => {
|
|
||||||
a.rel = "noopener";
|
|
||||||
a.target = "_blank";
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -12,6 +12,7 @@
|
||||||
"@babel/core": "^7.10.4",
|
"@babel/core": "^7.10.4",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
||||||
"@babel/preset-env": "^7.10.4",
|
"@babel/preset-env": "^7.10.4",
|
||||||
|
"@hotwired/turbo": "^7.0.0-rc.4",
|
||||||
"axe-core": "^4.1.2",
|
"axe-core": "^4.1.2",
|
||||||
"babel-loader": "^8.1.0",
|
"babel-loader": "^8.1.0",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
|
@ -22,7 +23,6 @@
|
||||||
"sassdoc-theme-herman": "^4.0.2",
|
"sassdoc-theme-herman": "^4.0.2",
|
||||||
"stimulus": "^1.1.1",
|
"stimulus": "^1.1.1",
|
||||||
"svgo": "^2.5.0",
|
"svgo": "^2.5.0",
|
||||||
"turbolinks": "^5.2.0",
|
|
||||||
"webpack": "^4.43.0",
|
"webpack": "^4.43.0",
|
||||||
"webpack-assets-manifest": "~4",
|
"webpack-assets-manifest": "~4",
|
||||||
"webpack-cli": "^3.3.12",
|
"webpack-cli": "^3.3.12",
|
||||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -880,6 +880,11 @@
|
||||||
"@babel/helper-validator-identifier" "^7.14.0"
|
"@babel/helper-validator-identifier" "^7.14.0"
|
||||||
to-fast-properties "^2.0.0"
|
to-fast-properties "^2.0.0"
|
||||||
|
|
||||||
|
"@hotwired/turbo@^7.0.0-rc.4":
|
||||||
|
version "7.0.0-rc.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.0.0-rc.4.tgz#d3ab9555544534f5ec649613553e72ff6c7d7122"
|
||||||
|
integrity sha512-4qx+6O6mUN+cSN+ZLGCOGc+2MxNrs7cFbmnWD6LIfiHAQyuNiIuB87Y5IAtOo8xj16fOBd2CdU1WRJya4Wkw0A==
|
||||||
|
|
||||||
"@sindresorhus/is@^0.14.0":
|
"@sindresorhus/is@^0.14.0":
|
||||||
version "0.14.0"
|
version "0.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
|
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
|
||||||
|
@ -6378,11 +6383,6 @@ tty-browserify@0.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
|
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
|
||||||
integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=
|
integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=
|
||||||
|
|
||||||
turbolinks@^5.2.0:
|
|
||||||
version "5.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/turbolinks/-/turbolinks-5.2.0.tgz#e6877a55ea5c1cb3bb225f0a4ae303d6d32ff77c"
|
|
||||||
integrity sha512-pMiez3tyBo6uRHFNNZoYMmrES/IaGgMhQQM+VFF36keryjb5ms0XkVpmKHkfW/4Vy96qiGW3K9bz0tF5sK9bBw==
|
|
||||||
|
|
||||||
type-fest@^0.8.1:
|
type-fest@^0.8.1:
|
||||||
version "0.8.1"
|
version "0.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
|
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
|
||||||
|
|
Loading…
Reference in a new issue