From 4cb78fa1eb001ad64343a2795218b3ab37b559a8 Mon Sep 17 00:00:00 2001 From: Raphael Aguiar Date: Sat, 4 Jun 2022 01:51:52 -0300 Subject: Overhaul image processing and other changes * Get rid of every single `.Scratch` * Bump KaTeX from 0.15.3 to 0.15.6 * Bump Fuse from 6.5.3 to 6.6.2 * Add cache busting to search indexes * Improve search results in general * Overhaul image processing * By default, use `webp` as an extra image format conditionally (Hugo 0.83+) * Other minor changes --- data/default.toml | 55 +++++++++++++++++++++++++++++++------- data/old/default.toml | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ data/old/what.toml | 27 +++++++++++++++++++ 3 files changed, 146 insertions(+), 9 deletions(-) create mode 100644 data/old/default.toml create mode 100644 data/old/what.toml (limited to 'data') diff --git a/data/default.toml b/data/default.toml index 746f27b..44040c9 100644 --- a/data/default.toml +++ b/data/default.toml @@ -4,16 +4,9 @@ minLength = 3 maxLength = 32 -[imageProc] - highRes = [ "1280x", "1280w" ] - mediumRes = [ "960x", "960w" ] - lowRes = [ "640x q90", "640w" ] - - markupAutoResizeWidth = 1280 - [style] - darkAccent = "#1dbc91" - lightAccent = "#1f676b" + darkAccent = "1dbc91" + lightAccent = "1f676b" changeTransition = ".3s ease" @@ -21,3 +14,47 @@ title = "Page not found" description = "This page was not found." paragraph = "Nothing to see here, buddy." + +[libs] + fusejs = "6.6.2" + katex = "0.15.6" + + +[imageProcessing] + + # Enable auto resize + # Includes "img" and "figure" shortcodes + autoResize = true + + # Convert "tiff" files to the format below + # since the most used browsers don't support it + fallbackOptions = "jpeg" + + # Fill options for Open Graph and Twitter Card images + # These images are also used in the Schema.org structured data + openGraphFillOptions = "1200x630" + twitterFillOptions = "1280x640" + + # Extra formats (along JPEG/PNG) + [[imageProcessing.extraFormats]] + formatOptions = "webp" + mediaType = "image/webp" + minVersion = "0.83" + + # Sizes at which images are resized + # Keep the sizes in descending order + # The smallest size will be used as the default image + [[imageProcessing.sizes]] + resizeOptions = "1280x" + descriptor = "1280w" + minWidth = 1280 + + [[imageProcessing.sizes]] + resizeOptions = "960x" + descriptor = "960w" + minWidth = 960 + + [[imageProcessing.sizes]] + resizeOptions = "640x q90" + descriptor = "640w" + minWidth = 640 diff --git a/data/old/default.toml b/data/old/default.toml new file mode 100644 index 0000000..92357f5 --- /dev/null +++ b/data/old/default.toml @@ -0,0 +1,73 @@ +# File dedicated to storing some default values + +[search] + minLength = 3 + maxLength = 32 + +[style] + darkAccent = "1dbc91" + lightAccent = "1f676b" + + changeTransition = ".3s ease" + +[notFound] + title = "Page not found" + description = "This page was not found." + paragraph = "Nothing to see here, buddy." + +[libs] + fusejs = "6.6.2" + katex = "0.15.6" + + +[imageProcessing] + + autoResize = true + + # Convert "tiff" files to the format below + # since the most used browsers don't support it + fallbackOptions = "jpeg" + + #defaultResize = "960x" + + openGraphFill = "1200x630" + twitterFill = "1280x640" + + #markupAutoResizeWidth = 1280 + + #[[imageProcessing.extraFormats]] + #formatOptions = "avif" + #mediaType = "image/avif" + #minVersion = "?" + + [[imageProcessing.extraFormats]] + formatOptions = "webp" + mediaType = "image/webp" + minVersion = "0.83" + + # Keep the sizes in descending order + [[imageProcessing.sizes]] + resizeOptions = "1280x" + label = "1280w" + minWidth = 1280 + + [[imageProcessing.sizes]] + resizeOptions = "960x" + label = "960w" + minWidth = 960 + + [[imageProcessing.sizes]] + resizeOptions = "640x q90" + label = "640w" + minWidth = 640 + #defaultResize = true + + #[[imageProcessing.sizes]] + #resizeOptions = "320x q90" + #label = "320w" + #minWidth = 320 + + #[[imageProcessing.sizes]] + #resizeOptions = "160x q90" + #label = "160w" + #minWidth = 160 diff --git a/data/old/what.toml b/data/old/what.toml new file mode 100644 index 0000000..570a811 --- /dev/null +++ b/data/old/what.toml @@ -0,0 +1,27 @@ +# File dedicated to storing some default values + +[search] + minLength = 3 + maxLength = 32 + +[imageProc] + highRes = [ "1280x", "1280w" ] + mediumRes = [ "960x", "960w" ] + lowRes = [ "640x q90", "640w" ] + + markupAutoResizeWidth = 1280 + +[style] + darkAccent = "#1dbc91" + lightAccent = "#1f676b" + + changeTransition = ".3s ease" + +[notFound] + title = "Page not found" + description = "This page was not found." + paragraph = "Nothing to see here, buddy." + +[libs] + fuse = "6.5.3" + katex = "0.15.3" -- cgit v1.2.3