Compare commits

..

5 commits

Author SHA1 Message Date
3fc9ac6745 Añadir CI para Webpack
All checks were successful
continuous-integration/drone the build was successful
2021-09-17 23:06:08 -03:00
c453a7f643 Merge branch 'svgo' into 'master'
Optimizar SVGs

See merge request sutty/jekyll/sutty-base-jekyll-theme!11
2021-09-17 19:02:13 +00:00
93e35ebf66 Merge branch 'buscador' into 'master'
Codificar correctamente los parámetros de búsqueda

See merge request sutty/jekyll/sutty-base-jekyll-theme!15
2021-09-17 18:50:01 +00:00
f
4151338500 Codificar correctamente los parámetros de búsqueda 2021-09-17 15:38:56 -03:00
f
f3bbef3532 Optimizar SVGs
Reduce el tamaño de un SVG simplificándolo, eliminando metadatos de
programas de edición, etc.
2021-09-01 17:31:20 -03:00
5 changed files with 99 additions and 3 deletions

25
.woodpecker.yml Normal file
View file

@ -0,0 +1,25 @@
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

View file

@ -84,6 +84,11 @@ node_modules: package.json
Gemfile.lock: Gemfile
$(MAKE) bundle args=install
# Para poder optimizar los SVG necesitamos trabajar sobre el mismo
# archivo, pero make no nos va a dejar, así que lo corremos siempre.
%.svg: always ## Optimizar un archivo SVG (% = ubicación del archivo)
$(MAKE) hain args='./node_modules/.bin/svgo $@'
# XXX: Cada vez que se reinicia el sistema, cambia la fecha de creación
# del pid 1 y lo usamos como medida para saber si hay que iniciar nginx.
# Si nginx se cae después de iniciarlo, no vamos a reiniciarlo así.

View file

@ -16,10 +16,10 @@ export default class extends Controller {
}
connect () {
const q = window.location.search.match(/^\?q=(?<q>.*)&?/)
const q = new URLSearchParams(window.location.search).get('q').trim()
if (q) {
this.qTarget.value = decodeURI(q.groups.q)
this.qTarget.value = q
this.search()
}
}
@ -52,8 +52,9 @@ export default class extends Controller {
const template = await request.text()
const html = await this.engine.parseAndRender(template, { q, site, results })
const title = `${site.i18n.search.title} - ${q}`
const query = new URLSearchParams({ q })
window.history.pushState({ q }, title, `?q=${encodeURI(q)}`)
window.history.pushState({ q }, title, `?${query.toString()}`)
document.title = title
main.innerHTML = html

View file

@ -21,6 +21,7 @@
"sassdoc": "^2.7.3",
"sassdoc-theme-herman": "^4.0.2",
"stimulus": "^1.1.1",
"svgo": "^2.5.0",
"turbolinks": "^5.2.0",
"webpack": "^4.43.0",
"webpack-assets-manifest": "~4",

View file

@ -916,6 +916,11 @@
dependencies:
defer-to-connect "^1.0.1"
"@trysound/sax@0.1.1":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.1.1.tgz#3348564048e7a2d7398c935d466c0414ebb6a669"
integrity sha512-Z6DoceYb/1xSg5+e+ZlPZ9v0N16ZvZ+wYMraFue4HYrE4ttONKtsvruIRf6t9TBR0YvSOfi1hUU0fJfBLCDYow==
"@types/caseless@*":
version "0.12.2"
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8"
@ -2029,6 +2034,11 @@ colorette@^1.2.2:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
colorette@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.3.0.tgz#ff45d2f0edb244069d3b772adeb04fed38d0a0af"
integrity sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==
combined-stream@^1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
@ -2058,6 +2068,11 @@ commander@^5.1.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==
commander@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==
commander@~2.19.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
@ -2303,6 +2318,25 @@ css-select@^4.1.2:
domutils "^2.6.0"
nth-check "^2.0.0"
css-select@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.1.3.tgz#a70440f70317f2669118ad74ff105e65849c7067"
integrity sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==
dependencies:
boolbase "^1.0.0"
css-what "^5.0.0"
domhandler "^4.2.0"
domutils "^2.6.0"
nth-check "^2.0.0"
css-tree@^1.1.2, css-tree@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d"
integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==
dependencies:
mdn-data "2.0.14"
source-map "^0.6.1"
css-what@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.1.tgz#3efa820131f4669a8ac2408f9c32e7c7de9f4cad"
@ -2313,6 +2347,13 @@ cssesc@^3.0.0:
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
csso@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529"
integrity sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==
dependencies:
css-tree "^1.1.2"
cyclist@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
@ -4352,6 +4393,11 @@ md5.js@^1.3.4:
inherits "^2.0.1"
safe-buffer "^5.1.2"
mdn-data@2.0.14:
version "2.0.14"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50"
integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==
mdurl@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
@ -5981,6 +6027,11 @@ ssri@^6.0.1:
dependencies:
figgy-pudding "^3.5.1"
stable@^0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf"
integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==
stackframe@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.2.0.tgz#52429492d63c62eb989804c11552e3d22e779303"
@ -6142,6 +6193,19 @@ supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"
svgo@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.5.0.tgz#3c9051b606d85a02fcb59f459b19970d2cc2c9bf"
integrity sha512-FSdBOOo271VyF/qZnOn1PgwCdt1v4Dx0Sey+U1jgqm1vqRYjPGdip0RGrFW6ItwtkBB8rHgHk26dlVr0uCs82Q==
dependencies:
"@trysound/sax" "0.1.1"
colorette "^1.3.0"
commander "^7.2.0"
css-select "^4.1.3"
css-tree "^1.1.3"
csso "^4.2.0"
stable "^0.1.8"
tapable@^1.0, tapable@^1.0.0, tapable@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"