1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 17:30:28 -04:00

better implementation of hugo mods for twemojis 📦

This commit is contained in:
Jake Jarvis 2020-04-06 08:44:43 -04:00
parent 4f71dd509b
commit 3224d9b072
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
8 changed files with 14 additions and 12 deletions

View File

@ -40,8 +40,8 @@ disableAliases = true
path = "github.com/twitter/twemoji" path = "github.com/twitter/twemoji"
disabled = false disabled = false
[[module.imports.mounts]] [[module.imports.mounts]]
source = "v/12.1.5" source = "assets/svg"
target = "static/vendor/emoji" target = "static/vendor/emoji/svg"
[author] [author]
name = "Jake Jarvis" name = "Jake Jarvis"

2
go.mod
View File

@ -2,4 +2,4 @@ module github.com/jakejarvis/jarv.is
go 1.14 go 1.14
require github.com/twitter/twemoji v12.0.5-0.20200128193524-d998789b5d5e+incompatible // indirect require github.com/twitter/twemoji v12.1.5+incompatible // indirect

3
go.sum
View File

@ -1,5 +1,2 @@
github.com/twitter/twemoji v1.4.2 h1:AOD6NuL0n39nxziFJRfYEhh3s5V9uxLVHLEoUNhrRf0=
github.com/twitter/twemoji v12.0.5-0.20200128193524-d998789b5d5e+incompatible h1:YgZzWr28GaMPQvDSDhD7SHfEYGxiYsvJmu1rCOGJttA=
github.com/twitter/twemoji v12.0.5-0.20200128193524-d998789b5d5e+incompatible/go.mod h1:06L6PdKuWDx/Yh6s4B7yGkAeBmWZzbFZgfNnWlJPPYM=
github.com/twitter/twemoji v12.1.5+incompatible h1:q2DZm6LI6aF46VSUhYsrWDd7IeBV1H/2uTjGXDhVyEA= github.com/twitter/twemoji v12.1.5+incompatible h1:q2DZm6LI6aF46VSUhYsrWDd7IeBV1H/2uTjGXDhVyEA=
github.com/twitter/twemoji v12.1.5+incompatible/go.mod h1:06L6PdKuWDx/Yh6s4B7yGkAeBmWZzbFZgfNnWlJPPYM= github.com/twitter/twemoji v12.1.5+incompatible/go.mod h1:06L6PdKuWDx/Yh6s4B7yGkAeBmWZzbFZgfNnWlJPPYM=

View File

@ -1,2 +1,2 @@
<script src="{{ "/vendor/emoji/twemoji.min.js" | absURL }}"></script> <script src="{{ "/vendor/emoji/emoji.min.js" | absURL }}"></script>
<script>twemoji.parse(document.body,{{ dict "base" ("/" | absURL) "folder" "vendor/emoji/svg" "ext" ".svg" | jsonify | safeJS }})</script> <script>twemoji.parse(document.body,{{ dict "base" ("/" | absURL) "folder" "vendor/emoji/svg" "ext" ".svg" | jsonify | safeJS }})</script>

View File

@ -146,6 +146,10 @@
from = "/twemoji/*" from = "/twemoji/*"
to = "/vendor/emoji/:splat" to = "/vendor/emoji/:splat"
status = 301 status = 301
[[redirects]]
from = "/vendor/emoji/twemoji.min.js"
to = "/vendor/emoji/emoji.min.js"
status = 301
# More miscellaneous mirrors: # More miscellaneous mirrors:
[[redirects]] [[redirects]]

View File

@ -16,12 +16,11 @@
"scripts": { "scripts": {
"clean": "rimraf public/ resources/ builds/", "clean": "rimraf public/ resources/ builds/",
"build": "run-s clean hugo optimize", "build": "run-s clean hugo optimize",
"build:preview": "run-s clean hugo:dev optimize:junk", "build:preview": "run-s clean hugo:dev",
"hugo": "hugo --gc --cleanDestinationDir --verbose", "hugo": "hugo --gc --cleanDestinationDir --verbose",
"hugo:dev": "hugo --environment development --baseURL ${DEPLOY_PRIME_URL:-/} --buildDrafts --buildFuture --gc --cleanDestinationDir --verbose", "hugo:dev": "hugo --environment development --baseURL ${DEPLOY_PRIME_URL:-/} --buildDrafts --buildFuture --gc --cleanDestinationDir --verbose",
"start": "hugo server --disableFastRender --buildDrafts --buildFuture --port 1337 --bind 0.0.0.0 --verbose", "start": "hugo server --disableFastRender --buildDrafts --buildFuture --port 1337 --bind 0.0.0.0 --verbose",
"optimize": "run-s optimize:**", "optimize": "run-s optimize:**",
"optimize:junk": "rimraf public/vendor/emoji/{*.html,72x72} public/*/amp.html",
"optimize:html": "html-minifier --html5 --collapse-whitespace --collapse-boolean-attributes --preserve-line-breaks --minify-css --file-ext html --input-dir public --output-dir public **/*.html", "optimize:html": "html-minifier --html5 --collapse-whitespace --collapse-boolean-attributes --preserve-line-breaks --minify-css --file-ext html --input-dir public --output-dir public **/*.html",
"optimize:img": "find ./public -type d ! -path './public/vendor*' | xargs -n1 -P8 -I{} imagemin {}/* --plugin=jpegoptim --plugin.jpegoptim.progressive --plugin.jpegoptim.stripAll --plugin=pngquant --plugin.pngquant.speed=5 --plugin.pngquant.strip --plugin=optipng --plugin.optipng.optimizationLevel=2 --plugin=gifsicle --plugin=svgo --out-dir={}", "optimize:img": "find ./public -type d ! -path './public/vendor*' | xargs -n1 -P8 -I{} imagemin {}/* --plugin=jpegoptim --plugin.jpegoptim.progressive --plugin.jpegoptim.stripAll --plugin=pngquant --plugin.pngquant.speed=5 --plugin.pngquant.strip --plugin=optipng --plugin.optipng.optimizationLevel=2 --plugin=gifsicle --plugin=svgo --out-dir={}",
"lint": "run-s lint:**", "lint": "run-s lint:**",

2
static/vendor/emoji/emoji.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -971,9 +971,9 @@ cli-cursor@^3.1.0:
restore-cursor "^3.1.0" restore-cursor "^3.1.0"
cli-spinners@^2.2.0: cli-spinners@^2.2.0:
version "2.2.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.2.0.tgz#e8b988d9206c692302d8ee834e7a85c0144d8f77" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.3.0.tgz#0632239a4b5aa4c958610142c34bb7a651fc8df5"
integrity sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ== integrity sha512-Xs2Hf2nzrvJMFKimOR7YR0QwZ8fc0u98kdtwN1eNAZzNQgH3vK2pXzff6GJtKh7S5hoJ87ECiAiZFS2fb5Ii2w==
cli-truncate@^0.2.1: cli-truncate@^0.2.1:
version "0.2.1" version "0.2.1"