Fix svg issuesUnverified
b7502b4 parent: e06433e modified
blog/hugo.toml +24 -0 | @@ -13,6 +13,30 @@ enableRobotsTXT = true | ||
| 13 | 13 | # it as posts/hello-world.fr.md, .pt.md, .ja.md, .es.md. |
| 14 | 14 | defaultContentLanguage = "en" |
| 15 | 15 | |
| 16 | +# `hugo --minify` (see flake.nix) runs tdewolff's SVG minifier over inline | |
| 17 | +# SVG, and its path-data optimizer rewrites every `d` into whichever mix of | |
| 18 | +# absolute, relative and shorthand commands is shortest for those particular | |
| 19 | +# numbers. Geometry is preserved; the command sequence is not - and two | |
| 20 | +# things here read the commands, not just the shape: | |
| 21 | +# | |
| 22 | +# - partials/masthead.html's signal. style.scss transitions `d` so the | |
| 23 | +# curve morphs point-by-point on a boosted navigation, which the browser | |
| 24 | +# will only do between paths with an identical command sequence. The | |
| 25 | +# template emits a fixed M + 30 C per page, but minified they came out | |
| 26 | +# as e.g. `McCcCcCsC` (home) vs `MCcCcCcsCcCSsCcCcCsC` (a post), so | |
| 27 | +# Chrome could not interpolate and the line snapped instead. | |
| 28 | +# - shortcodes/hello-world.html's plate, whose script parses the word out | |
| 29 | +# of its own `d` with /M(\d+) (\d+)h(\d+)v(\d+)/. Minified, `M13 0h10v3h-10z` | |
| 30 | +# becomes `m5 0h10v3H13z` and only 22 of the 61 rectangles still matched, | |
| 31 | +# so the canvas drew a word full of holes. | |
| 32 | +# | |
| 33 | +# Neither survives having the commands rewritten, and the minifier exposes no | |
| 34 | +# setting to keep them (Hugo surfaces only svg.keepnamespaces). Turning it off | |
| 35 | +# costs ~170 bytes gzipped on a page; HTML, CSS and JS minification are | |
| 36 | +# untouched. | |
| 37 | +[minify] | |
| 38 | +disableSVG = true | |
| 39 | + | |
| 16 | 40 | [permalinks] |
| 17 | 41 | [permalinks.page] |
| 18 | 42 | posts = "/:year/:month/:day/:slug/" |
| @@ -13,6 +13,30 @@ enableRobotsTXT = true | |||
| 13 | # it as posts/hello-world.fr.md, .pt.md, .ja.md, .es.md. | 13 | # it as posts/hello-world.fr.md, .pt.md, .ja.md, .es.md. |
| 14 | defaultContentLanguage = "en" | 14 | defaultContentLanguage = "en" |
| 15 | 15 | ||
| 16 | +# `hugo --minify` (see flake.nix) runs tdewolff's SVG minifier over inline | ||
| 17 | +# SVG, and its path-data optimizer rewrites every `d` into whichever mix of | ||
| 18 | +# absolute, relative and shorthand commands is shortest for those particular | ||
| 19 | +# numbers. Geometry is preserved; the command sequence is not - and two | ||
| 20 | +# things here read the commands, not just the shape: | ||
| 21 | +# | ||
| 22 | +# - partials/masthead.html's signal. style.scss transitions `d` so the | ||
| 23 | +# curve morphs point-by-point on a boosted navigation, which the browser | ||
| 24 | +# will only do between paths with an identical command sequence. The | ||
| 25 | +# template emits a fixed M + 30 C per page, but minified they came out | ||
| 26 | +# as e.g. `McCcCcCsC` (home) vs `MCcCcCcsCcCSsCcCcCsC` (a post), so | ||
| 27 | +# Chrome could not interpolate and the line snapped instead. | ||
| 28 | +# - shortcodes/hello-world.html's plate, whose script parses the word out | ||
| 29 | +# of its own `d` with /M(\d+) (\d+)h(\d+)v(\d+)/. Minified, `M13 0h10v3h-10z` | ||
| 30 | +# becomes `m5 0h10v3H13z` and only 22 of the 61 rectangles still matched, | ||
| 31 | +# so the canvas drew a word full of holes. | ||
| 32 | +# | ||
| 33 | +# Neither survives having the commands rewritten, and the minifier exposes no | ||
| 34 | +# setting to keep them (Hugo surfaces only svg.keepnamespaces). Turning it off | ||
| 35 | +# costs ~170 bytes gzipped on a page; HTML, CSS and JS minification are | ||
| 36 | +# untouched. | ||
| 37 | +[minify] | ||
| 38 | +disableSVG = true | ||
| 39 | + | ||
| 16 | [permalinks] | 40 | [permalinks] |
| 17 | [permalinks.page] | 41 | [permalinks.page] |
| 18 | posts = "/:year/:month/:day/:slug/" | 42 | posts = "/:year/:month/:day/:slug/" |