diff options
author | Raphael Aguiar <rmaguiar@tuta.io> | 2022-06-04 07:51:52 +0300 |
---|---|---|
committer | Raphael Aguiar <rmaguiar@tuta.io> | 2022-06-04 07:52:09 +0300 |
commit | 4cb78fa1eb001ad64343a2795218b3ab37b559a8 (patch) | |
tree | 0f99436eee9d736e460a81e15896755d98f618d9 | |
parent | b767c4e39893384d6821e357ba6d4c901a5eb9b7 (diff) |
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
-rw-r--r-- | README.md | 61 | ||||
-rw-r--r-- | archetypes/search.md | 1 | ||||
-rw-r--r-- | assets/js/search.js | 183 | ||||
-rw-r--r-- | assets/json/search.json | 58 | ||||
-rw-r--r-- | assets/libs/katex@0.15.6/dist/contrib/auto-render.js (renamed from assets/libs/katex@0.15.3/dist/contrib/auto-render.js) | 0 | ||||
-rw-r--r-- | assets/libs/katex@0.15.6/dist/contrib/copy-tex.css (renamed from assets/libs/katex@0.15.3/dist/contrib/copy-tex.css) | 0 | ||||
-rw-r--r-- | assets/libs/katex@0.15.6/dist/contrib/copy-tex.js (renamed from assets/libs/katex@0.15.3/dist/contrib/copy-tex.js) | 0 | ||||
-rw-r--r-- | assets/libs/katex@0.15.6/dist/contrib/mhchem.js (renamed from assets/libs/katex@0.15.3/dist/contrib/mhchem.js) | 2 | ||||
-rw-r--r-- | assets/libs/katex@0.15.6/dist/katex.css (renamed from assets/libs/katex@0.15.3/dist/katex.css) | 2 | ||||
-rw-r--r-- | assets/libs/katex@0.15.6/dist/katex.js (renamed from assets/libs/katex@0.15.3/dist/katex.js) | 219 | ||||
-rw-r--r-- | assets/scss/base/mixins.scss | 9 | ||||
-rw-r--r-- | assets/scss/colors/chroma/dark.scss | 4 | ||||
-rw-r--r-- | assets/scss/colors/chroma/light.scss | 4 | ||||
-rw-r--r-- | assets/scss/fonts/variables.scss | 2 | ||||
-rw-r--r-- | assets/scss/main.scss | 135 | ||||
-rw-r--r-- | data/default.toml | 55 | ||||
-rw-r--r-- | data/old/default.toml | 73 | ||||
-rw-r--r-- | data/old/what.toml | 27 | ||||
-rw-r--r-- | layouts/_default/_markup/render-heading.html | 2 | ||||
-rw-r--r-- | layouts/_default/_markup/render-image.html | 113 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 16 | ||||
-rw-r--r-- | layouts/_default/list.html | 6 | ||||
-rw-r--r-- | layouts/_default/search.html | 19 | ||||
-rw-r--r-- | layouts/_default/search.json.json | 83 | ||||
-rw-r--r-- | layouts/_default/single.html | 4 | ||||
-rw-r--r-- | layouts/partials/basic-tags.html | 83 | ||||
-rw-r--r-- | layouts/partials/cover.html | 89 | ||||
-rw-r--r-- | layouts/partials/footer-opt.html | 6 | ||||
-rw-r--r-- | layouts/partials/head-cover.html | 79 | ||||
-rw-r--r-- | layouts/partials/head.html | 209 | ||||
-rw-r--r-- | layouts/partials/katex-font-preload.html | 2 | ||||
-rw-r--r-- | layouts/partials/katex.html | 2 | ||||
-rw-r--r-- | layouts/partials/pagination.html | 14 | ||||
-rw-r--r-- | layouts/partials/processed-content.html | 25 | ||||
-rw-r--r-- | layouts/partials/search-form.html | 6 | ||||
-rw-r--r-- | layouts/partials/search-index.html | 3 | ||||
-rw-r--r-- | layouts/partials/svg-bundle.html | 5 | ||||
-rw-r--r-- | layouts/partials/utilities/image-processing-config.html | 6 | ||||
-rw-r--r-- | layouts/partials/utilities/image-processing.html | 114 | ||||
-rw-r--r-- | layouts/shortcodes/figure.html | 125 | ||||
-rw-r--r-- | layouts/shortcodes/gifoid.html | 33 | ||||
-rw-r--r-- | layouts/shortcodes/img.html | 101 | ||||
-rw-r--r-- | layouts/shortcodes/social.html | 6 | ||||
-rw-r--r-- | static/libs/fuse.js@6.5.3/dist/fuse.basic.esm.min.js | 9 | ||||
-rw-r--r-- | static/libs/fuse.js@6.6.2/dist/fuse.basic.esm.min.js | 9 | ||||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.ttf) | bin | 63632 -> 63632 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.woff) | bin | 33516 -> 33516 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.woff2) | bin | 28076 -> 28076 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.ttf) | bin | 12368 -> 12368 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.woff) | bin | 7716 -> 7716 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.woff2) | bin | 6912 -> 6912 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.ttf) | bin | 12344 -> 12344 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.woff) | bin | 7656 -> 7656 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.woff2) | bin | 6908 -> 6908 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.ttf) | bin | 19584 -> 19584 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.woff) | bin | 13296 -> 13296 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.woff2) | bin | 11348 -> 11348 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.ttf) | bin | 19572 -> 19572 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.woff) | bin | 13208 -> 13208 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.woff2) | bin | 11316 -> 11316 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.ttf) | bin | 51336 -> 51336 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.woff) | bin | 29912 -> 29912 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.woff2) | bin | 25324 -> 25324 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.ttf) | bin | 32968 -> 32968 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.woff) | bin | 19412 -> 19412 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.woff2) | bin | 16780 -> 16780 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.ttf) | bin | 33580 -> 33580 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.woff) | bin | 19676 -> 19676 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.woff2) | bin | 16988 -> 16988 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.ttf) | bin | 53580 -> 53580 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.woff) | bin | 30772 -> 30772 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.woff2) | bin | 26272 -> 26272 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.ttf) | bin | 31196 -> 31196 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.woff) | bin | 18668 -> 18668 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.woff2) | bin | 16400 -> 16400 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.ttf) | bin | 31308 -> 31308 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.woff) | bin | 18748 -> 18748 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.woff2) | bin | 16440 -> 16440 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.ttf) | bin | 24504 -> 24504 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.woff) | bin | 14408 -> 14408 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.woff2) | bin | 12216 -> 12216 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.ttf) | bin | 22364 -> 22364 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.woff) | bin | 14112 -> 14112 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.woff2) | bin | 12028 -> 12028 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.ttf) | bin | 19436 -> 19436 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.woff) | bin | 12316 -> 12316 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.woff2) | bin | 10344 -> 10344 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.ttf) | bin | 16648 -> 16648 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.woff) | bin | 10588 -> 10588 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.woff2) | bin | 9644 -> 9644 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.ttf) | bin | 12228 -> 12228 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.woff) | bin | 6496 -> 6496 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.woff2) | bin | 5468 -> 5468 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.ttf) | bin | 11508 -> 11508 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.woff) | bin | 6188 -> 6188 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.woff2) | bin | 5208 -> 5208 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.ttf) | bin | 7588 -> 7588 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.woff) | bin | 4420 -> 4420 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.woff2) | bin | 3624 -> 3624 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.ttf) | bin | 10364 -> 10364 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.woff) | bin | 5980 -> 5980 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.woff2) | bin | 4928 -> 4928 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.ttf (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.ttf) | bin | 27556 -> 27556 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.woff (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.woff) | bin | 16028 -> 16028 bytes | |||
-rw-r--r-- | static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.woff2 (renamed from static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.woff2) | bin | 13568 -> 13568 bytes |
105 files changed, 1379 insertions, 625 deletions
@@ -26,7 +26,7 @@ I've been working on this theme for so long that there are features I don't even * Privacy-aware to an extent (no Google Analytics/Fonts, Disqus, etc); * Social shortcode including centralized and decentralized platforms; * Contact form shortcode (via [Formspree](https://formspree.io/)); -* Open Graph, Twitter Cards and Structured Data (schema.org) meta tags; +* Open Graph, Twitter Cards and structured data (Schema.org) meta tags; * Responsive images via image processing; * Basic search functionality via [Fuse.js](https://github.com/krisk/Fuse); * Image lazy loading; @@ -111,25 +111,58 @@ To disable it, you can just remove the `noClasses = false` (as its default value ## Image processing -By default, images with width equal or greater than 1280 pixels are processed (resized) into 3 resolutions: 1280x, 960x and 640x (this one with quality at 90, as opposed to the default 75). +By default, images are responsive. This is achieved through image processing, where images are resized depending on their width. -You can change this behavior via config: +For example, images with width equal or greater than 1280 pixels are processed (resized) into 3 sizes: `1280x`, `960x` and `640x`. + +If using Hugo v0.83 or above, a set of WEBP files will be generated as well. + +Cover images will *also* be resized (using the [Fill](https://gohugo.io/content-management/image-processing/#fill) method) for Open Graph (`1200x630`) and Twitter Cards (`1280x640`). + +You can change this behavior via config. Below you can find the default params: ```toml -[params.imageProc] - highRes = [ "1280x", "1280w" ] - mediumRes = [ "960x", "960w" ] - lowRes = [ "640x q90", "640w" ] - # entry = [ resize options, condition ] +[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 - # Images with width equal or greater this value - # will be processed into the 3 resolutions above - # Valid only for images rendered via markdown - # The default value is 1280 - markupAutoResizeWidth = 1280 + [[imageProcessing.sizes]] + resizeOptions = "640x q90" + descriptor = "640w" + minWidth = 640 ``` -The shortcodes `img` and `figure` will **always** process images and cover images will *also* process resolutions for Open Graph (1200x630) and Twitter (1280x640). +When using the shortcodes `img` and `figure`, image processing can also be disabled by setting the `resize` param as `false`. ## Shortcodes diff --git a/archetypes/search.md b/archetypes/search.md index fee01c5..12591d4 100644 --- a/archetypes/search.md +++ b/archetypes/search.md @@ -6,5 +6,4 @@ stopWords: [ a, an, and, in, the, to, was, were, with ] sitemapExclude: true noindex: true disableTitleSeparator: false -outputs: [ html, json ] --- diff --git a/assets/js/search.js b/assets/js/search.js index 44a22d8..47dda3e 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -6,100 +6,19 @@ 'use strict'; const fuseOptions = { - shouldSort: true, - threshold: 0, - ignoreLocation: true, - maxPatternLength: {{ .Site.Params.Search.maxLength | default .Site.Data.default.search.maxLength }}, - minMatchCharLength: {{ .Site.Params.Search.minLength | default .Site.Data.default.search.minLength }}, keys: [ { name: 'title', weight: .4 }, { name: 'tags', weight: .3 }, { name: 'description', weight: .2 }, { name: 'content', weight: .1 } - ] -} - -// Sanitize -function getUrlParameter(name) { - name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); - const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); - const results = regex.exec(location.search); - return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); -} - -// Capture input -const searchQuery = getUrlParameter('q'); - -// Search info section -const searchInfo = document.querySelector('#search-info'); - -// Show message -function report(message, type) { - const el = document.createElement('p'); - - el.textContent = message; - - if (type) { - el.classList.add(type); - } - - searchInfo.appendChild(el); -} - -if (searchQuery) { - - // Transfer text to search field - document.querySelector('.search-box input') - .value = searchQuery; - - executeSearch(searchQuery); - report('{{ T "searchProcessing" }}'); - -} else { - report('{{ T "searchAwaitingSearch" }}'); -} - - -function executeSearch(searchQuery) { - fetch('index.json') - .then((response) => { - return response.json(); - }) - .then((data) => { - - // Limit results and throw an error if too many pages are found - const limit = {{ .Site.Params.Search.maxResults | default 30 }}; - - import('/libs/fuse.js@6.5.3/dist/fuse.basic.esm.min.js') - .then((fuseBasic) => { - const fuse = new fuseBasic.default(data, fuseOptions); - return fuse.search(searchQuery); - }) - .then((output) => { - searchInfo.firstElementChild.remove(); - report('{{ T "searchResultsFor" }}: ' + searchQuery); - - const matches = output.length; - - if (matches > 0) { - if (matches === 1) { - report('{{ T "searchOnePageFound" }}.'); - } else if (1 < matches && matches < limit + 1) { - report(matches + ' {{ T "searchPagesFound" }}.'); - } else { - report('{{ T "searchTooMany" }}', 'error'); - } - } else { - report('{{ T "searchNoPageFound" }}', 'error'); - } - - if (0 < matches && matches < limit + 1) { - populateResults(output); - } - }); - }); + ], + ignoreLocation: true, + minMatchCharLength: {{ .Site.Params.Search.minLength | default .Site.Data.default.search.minLength }}, + shouldSort: false, + threshold: 0 } +const searchResults = document.querySelector('#search-results'); // Populate results function populateResults(output) { @@ -139,7 +58,93 @@ function populateResults(output) { postLink.appendChild(htmlPostTitle); } - document.querySelector('#search-results') - .appendChild(resultsTemplate); + searchResults.appendChild(resultsTemplate); }); } + + +// Search info section +const searchInfo = document.querySelector('#search-info'); + +// Show message +function report(message, type) { + const el = document.createElement('p'); + + el.textContent = message; + + if (type) { + el.classList.add(type); + } + + searchInfo.appendChild(el); +} + + +function executeSearch(query) { + fetch(searchResults.getAttribute('data-search-index')) + .then((response) => { + return response.json(); + }) + .then((data) => { + + // Limit results and throw an error if too many pages are found + const limit = {{ .Site.Params.Search.maxResults | default 30 }}; + + import( + '/libs/fuse.js@' + + searchResults.getAttribute('data-lib-version') + + '/dist/fuse.basic.esm.min.js' + ) + .then((fuseBasic) => { + const fuse = new fuseBasic.default(data, fuseOptions); + return fuse.search(query); + }) + .then((output) => { + searchInfo.firstElementChild.remove(); + report('{{ T "searchResultsFor" }}: ' + query); + + const matches = output.length; + + if (matches > 0) { + if (matches === 1) { + report('{{ T "searchOnePageFound" }}.'); + } else if (1 < matches && matches < limit + 1) { + report(matches + ' {{ T "searchPagesFound" }}.'); + } else { + report('{{ T "searchTooMany" }}', 'error'); + } + } else { + report('{{ T "searchNoPageFound" }}', 'error'); + } + + if (0 < matches && matches < limit + 1) { + populateResults(output); + } + }); + }); +} + + +// Sanitize +function getUrlParameter(string) { + string = string.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); + const regex = new RegExp('[\\?&]' + string + '=([^&#]*)'); + const results = regex.exec(location.search); + return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); +} + +// Capture input +const searchQuery = getUrlParameter('q'); + +if (searchQuery) { + + // Transfer text to search field + document.querySelector('.search-box input') + .value = searchQuery; + + executeSearch(searchQuery); + report('{{ T "searchProcessing" }}'); + +} else { + report('{{ T "searchAwaitingSearch" }}'); +} diff --git a/assets/json/search.json b/assets/json/search.json new file mode 100644 index 0000000..234d5c8 --- /dev/null +++ b/assets/json/search.json @@ -0,0 +1,58 @@ +{{- $stopWords := or .Params.stopWords .Site.Params.Search.stopWords -}} + +{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} +{{- $pages = where $pages "Params.noindex" "ne" true -}} + +{{- $searchIndex := slice -}} + +{{- range $pages -}} + + {{- $date := false -}} + {{- $description := false -}} + {{- $tags := false -}} + + {{- if not .Date.IsZero -}} + {{- $date = (.Date.Format "2006-01-02") -}} + {{- end -}} + + {{- if .Description -}} + {{- $description = (.Description | emojify) -}} + {{- end -}} + + {{- if .Params.tags -}} + {{- $tags = .Params.tags -}} + {{- end -}} + + {{- $filteredContent := (.Content | replaceRE "<pre(.|\n)+?</pre>" "") -}} + {{- $filteredContent = ($filteredContent | replaceRE "<!--(.|\n)+?-->" "") -}} + {{- $filteredContent = ($filteredContent | replaceRE "(?s)<p class=\"error\".*?</p>" "") -}} + {{- $filteredContent = ($filteredContent | plainify | lower) -}} + {{- $filteredContent = ($filteredContent | replaceRE "(“|”|’|<|>|…)" "") -}} + {{- $filteredContent = ($filteredContent | replaceRE "(\n|\r|\t)+" " ") -}} + {{- $filteredContent = ($filteredContent | replaceRE "(\\(|\\)|\\[|\\]|\\,|\\:|\\;|\\!|\\?|\"|“|”)" "") -}} + {{- $filteredContent = ($filteredContent | replaceRE "(\\. |\\/| +)" " ") -}} + {{- $filteredContent = ($filteredContent | replaceRE " ↩︎" "") -}} + {{- $filteredContent = (trim $filteredContent " ") -}} + + {{- $words := (split $filteredContent " ") -}} + + {{- $currentWords := slice -}} + + + {{- range $words -}} + {{- $word := . -}} + {{- if and (ne (substr $word 0 1) $word) (not (in $stopWords $word)) -}} + {{- $currentWords = $currentWords | append $word -}} + {{- end -}} + {{- end -}} + + + {{- if $currentWords -}} + {{- $currentWords = (delimit $currentWords " ") -}} + {{- end -}} + + {{- $searchIndex = $searchIndex | append (dict "title" (.Title | emojify) "date" $date "description" $description "content" $currentWords "permalink" .RelPermalink "tags" $tags) -}} + +{{- end -}} + +{{- jsonify $searchIndex | replaceRE "false" "null" -}} diff --git a/assets/libs/katex@0.15.3/dist/contrib/auto-render.js b/assets/libs/katex@0.15.6/dist/contrib/auto-render.js index 6980cdd..6980cdd 100644 --- a/assets/libs/katex@0.15.3/dist/contrib/auto-render.js +++ b/assets/libs/katex@0.15.6/dist/contrib/auto-render.js diff --git a/assets/libs/katex@0.15.3/dist/contrib/copy-tex.css b/assets/libs/katex@0.15.6/dist/contrib/copy-tex.css index 6999c63..6999c63 100644 --- a/assets/libs/katex@0.15.3/dist/contrib/copy-tex.css +++ b/assets/libs/katex@0.15.6/dist/contrib/copy-tex.css diff --git a/assets/libs/katex@0.15.3/dist/contrib/copy-tex.js b/assets/libs/katex@0.15.6/dist/contrib/copy-tex.js index bf54df2..bf54df2 100644 --- a/assets/libs/katex@0.15.3/dist/contrib/copy-tex.js +++ b/assets/libs/katex@0.15.6/dist/contrib/copy-tex.js diff --git a/assets/libs/katex@0.15.3/dist/contrib/mhchem.js b/assets/libs/katex@0.15.6/dist/contrib/mhchem.js index c557b4e..3109305 100644 --- a/assets/libs/katex@0.15.3/dist/contrib/mhchem.js +++ b/assets/libs/katex@0.15.6/dist/contrib/mhchem.js @@ -154,7 +154,7 @@ katex__WEBPACK_IMPORTED_MODULE_0___default().__defineMacro("\\tripledash", "{\\v var chemParse = function chemParse(tokens, stateMachine) { // Recreate the argument string from KaTeX's array of tokens. var str = ""; - var expectedLoc = tokens[tokens.length - 1].loc.start; + var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start; for (var i = tokens.length - 1; i >= 0; i--) { if (tokens[i].loc.start > expectedLoc) { diff --git a/assets/libs/katex@0.15.3/dist/katex.css b/assets/libs/katex@0.15.6/dist/katex.css index f6bd80c..3cbfc22 100644 --- a/assets/libs/katex@0.15.3/dist/katex.css +++ b/assets/libs/katex@0.15.6/dist/katex.css @@ -130,7 +130,7 @@ border-color: currentColor; } .katex .katex-version::after { - content: "0.15.3"; + content: "0.15.6"; } .katex .katex-mathml { /* Accessibility hack to only show to screen readers diff --git a/assets/libs/katex@0.15.3/dist/katex.js b/assets/libs/katex@0.15.6/dist/katex.js index 9ce69ca..6758bf6 100644 --- a/assets/libs/katex@0.15.3/dist/katex.js +++ b/assets/libs/katex@0.15.6/dist/katex.js @@ -16125,7 +16125,70 @@ defineMacro("\\bra", "\\mathinner{\\langle{#1}|}"); defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}"); defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}"); defineMacro("\\Bra", "\\left\\langle#1\\right|"); -defineMacro("\\Ket", "\\left|#1\\right\\rangle"); ////////////////////////////////////////////////////////////////////// +defineMacro("\\Ket", "\\left|#1\\right\\rangle"); + +var braketHelper = function braketHelper(one) { + return function (context) { + var left = context.consumeArg().tokens; + var middle = context.consumeArg().tokens; + var middleDouble = context.consumeArg().tokens; + var right = context.consumeArg().tokens; + var oldMiddle = context.macros.get("|"); + var oldMiddleDouble = context.macros.get("\\|"); + context.macros.beginGroup(); + + var midMacro = function midMacro(double) { + return function (context) { + if (one) { + // Only modify the first instance of | or \| + context.macros.set("|", oldMiddle); + + if (middleDouble.length) { + context.macros.set("\\|", oldMiddleDouble); + } + } + + var doubled = double; + + if (!double && middleDouble.length) { + // Mimic \@ifnextchar + var nextToken = context.future(); + + if (nextToken.text === "|") { + context.popToken(); + doubled = true; + } + } + + return { + tokens: doubled ? middleDouble : middle, + numArgs: 0 + }; + }; + }; + + context.macros.set("|", midMacro(false)); + + if (middleDouble.length) { + context.macros.set("\\|", midMacro(true)); + } + + var arg = context.consumeArg().tokens; + var expanded = context.expandTokens([].concat(right, arg, left)); + context.macros.endGroup(); + return { + tokens: expanded.reverse(), + numArgs: 0 + }; + }; +}; + +defineMacro("\\bra@ket", braketHelper(false)); +defineMacro("\\bra@set", braketHelper(true)); +defineMacro("\\Braket", "\\bra@ket{\\left\\langle}" + "{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"); +defineMacro("\\Set", "\\bra@set{\\left\\{\\:}" + "{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"); +defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"); // has no support for special || or \| +////////////////////////////////////////////////////////////////////// // actuarialangle.dtx defineMacro("\\angln", "{\\angl n}"); // Custom Khan Academy colors, should be moved to an optional package @@ -16595,7 +16658,9 @@ var MacroExpander = /*#__PURE__*/function () { return this.macros.has(name) ? this.expandTokens([new Token(name)]) : undefined; } /** - * Fully expand the given token stream and return the resulting list of tokens + * Fully expand the given token stream and return the resulting list of + * tokens. Note that the input tokens are in reverse order, but the + * output tokens are in forward order. */ ; @@ -16720,6 +16785,113 @@ var MacroExpander = /*#__PURE__*/function () { }(); +;// CONCATENATED MODULE: ./src/unicodeSupOrSub.js +// Helpers for Parser.js handling of Unicode (sub|super)script characters. +var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/; +var uSubsAndSups = Object.freeze({ + '₊': '+', + '₋': '-', + '₌': '=', + '₍': '(', + '₎': ')', + '₀': '0', + '₁': '1', + '₂': '2', + '₃': '3', + '₄': '4', + '₅': '5', + '₆': '6', + '₇': '7', + '₈': '8', + '₉': '9', + "\u2090": 'a', + "\u2091": 'e', + "\u2095": 'h', + "\u1D62": 'i', + "\u2C7C": 'j', + "\u2096": 'k', + "\u2097": 'l', + "\u2098": 'm', + "\u2099": 'n', + "\u2092": 'o', + "\u209A": 'p', + "\u1D63": 'r', + "\u209B": 's', + "\u209C": 't', + "\u1D64": 'u', + "\u1D65": 'v', + "\u2093": 'x', + "\u1D66": 'β', + "\u1D67": 'γ', + "\u1D68": 'ρ', + "\u1D69": "\u03D5", + "\u1D6A": 'χ', + '⁺': '+', + '⁻': '-', + '⁼': '=', + '⁽': '(', + '⁾': ')', + '⁰': '0', + '¹': '1', + '²': '2', + '³': '3', + '⁴': '4', + '⁵': '5', + '⁶': '6', + '⁷': '7', + '⁸': '8', + '⁹': '9', + "\u1D2C": 'A', + "\u1D2E": 'B', + "\u1D30": 'D', + "\u1D31": 'E', + "\u1D33": 'G', + "\u1D34": 'H', + "\u1D35": 'I', + "\u1D36": 'J', + "\u1D37": 'K', + "\u1D38": 'L', + "\u1D39": 'M', + "\u1D3A": 'N', + "\u1D3C": 'O', + "\u1D3E": 'P', + "\u1D3F": 'R', + "\u1D40": 'T', + "\u1D41": 'U', + "\u2C7D": 'V', + "\u1D42": 'W', + "\u1D43": 'a', + "\u1D47": 'b', + "\u1D9C": 'c', + "\u1D48": 'd', + "\u1D49": 'e', + "\u1DA0": 'f', + "\u1D4D": 'g', + "\u02B0": 'h', + "\u2071": 'i', + "\u02B2": 'j', + "\u1D4F": 'k', + "\u02E1": 'l', + "\u1D50": 'm', + "\u207F": 'n', + "\u1D52": 'o', + "\u1D56": 'p', + "\u02B3": 'r', + "\u02E2": 's', + "\u1D57": 't', + "\u1D58": 'u', + "\u1D5B": 'v', + "\u02B7": 'w', + "\u02E3": 'x', + "\u02B8": 'y', + "\u1DBB": 'z', + "\u1D5D": 'β', + "\u1D5E": 'γ', + "\u1D5F": 'δ', + "\u1D60": "\u03D5", + "\u1D61": 'χ', + "\u1DBF": 'θ' +}); ;// CONCATENATED MODULE: ./src/Parser.js /* eslint no-constant-condition:0 */ @@ -16731,6 +16903,7 @@ var MacroExpander = /*#__PURE__*/function () { + // Pre-evaluate both modules as unicodeSymbols require String.normalize() var unicodeAccents = { @@ -17531,6 +17704,46 @@ var Parser = /*#__PURE__*/function () { mode: this.mode, body: primes }; + } else if (uSubsAndSups[lex.text]) { + // A Unicode subscript or superscript character. + // We treat these similarly to the unicode-math package. + // So we render a string of Unicode (sub|super)scripts the + // same as a (sub|super)script of regular characters. + var str = uSubsAndSups[lex.text]; + var isSub = unicodeSubRegEx.test(lex.text); + this.consume(); // Continue fetching tokens to fill out the string. + + while (true) { + var token = this.fetch().text; + + if (!uSubsAndSups[token]) { + break; + } + + if (unicodeSubRegEx.test(token) !== isSub) { + break; + } + + this.consume(); + str += uSubsAndSups[token]; + } // Now create a (sub|super)script. + + + var body = new Parser(str, this.settings).parse(); + + if (isSub) { + subscript = { + type: "ordgroup", + mode: "math", + body: body + }; + } else { + superscript = { + type: "ordgroup", + mode: "math", + body: body + }; + } } else { // If it wasn't ^, _, or ', stop parsing super/subscripts break; @@ -18351,7 +18564,7 @@ var renderToHTMLTree = function renderToHTMLTree(expression, options) { /** * Current KaTeX version */ - version: "0.15.3", + version: "0.15.6", /** * Renders the given LaTeX into an HTML+MathML combination, and adds diff --git a/assets/scss/base/mixins.scss b/assets/scss/base/mixins.scss index 639a919..33eb737 100644 --- a/assets/scss/base/mixins.scss +++ b/assets/scss/base/mixins.scss @@ -30,3 +30,12 @@ @content; } } + +// HACK +// For some reason, Chrome will leave a small gap between the +// border and the element depending on the resolution +// The gap can be filled by using "box-shadow" +@mixin chrome-border($border-width, $border-color) { + border: $border-width solid $border-color; + box-shadow: inset 0 0 0 $border-width $border-color; +} diff --git a/assets/scss/colors/chroma/dark.scss b/assets/scss/colors/chroma/dark.scss index ca623d2..90ab250 100644 --- a/assets/scss/colors/chroma/dark.scss +++ b/assets/scss/colors/chroma/dark.scss @@ -47,8 +47,8 @@ li code { .chroma .lnt, .chroma .ln { - margin-right: .4em; - padding: 0 .4em; + margin-right: 0.5rem; + padding: 0 0.5rem 0 1.5rem; color: #8e8e8e; } diff --git a/assets/scss/colors/chroma/light.scss b/assets/scss/colors/chroma/light.scss index 9e864d5..3e1e633 100644 --- a/assets/scss/colors/chroma/light.scss +++ b/assets/scss/colors/chroma/light.scss @@ -61,8 +61,8 @@ li code { .chroma .lnt, .chroma .ln { - margin-right: .4em; - padding: 0 .4em; + margin-right: 0.5rem; + padding: 0 0.5rem 0 1.5rem; color: #848f8f; } diff --git a/assets/scss/fonts/variables.scss b/assets/scss/fonts/variables.scss index f09b1d3..a9e1d8f 100644 --- a/assets/scss/fonts/variables.scss +++ b/assets/scss/fonts/variables.scss @@ -8,3 +8,5 @@ $heading-scaling-factor: .25; $heading-weight: 700; $body-bold-weight: 700; + +$body-line-height: 1.5rem; diff --git a/assets/scss/main.scss b/assets/scss/main.scss index 5d53496..0c793d2 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -87,15 +87,15 @@ html { // RESPONSIVENESS
// Margin for blockquote
- --blk-mg: 1.05rem .75rem;
+ --blk-mg: 1.05rem 0.75rem;
// Padding for highlight
- --hl-pad: 15px 18px;
+ //--hl-pad: 15px 18px;
--il-pad: 0 12px;
// Padding for highlight with line numbers
- --lnhl-pad: 3px 18px;
+ //--lnhl-pad: 3px 18px;
}
@@ -120,7 +120,7 @@ body { word-break: break-word;
&:hover {
- opacity: .75;
+ opacity: 0.75;
}
}
@@ -163,7 +163,7 @@ body { margin: 0 7.5px 15px;
padding: 9px 21px 12px;
- font-size: .75rem;
+ font-size: 0.75rem;
font-weight: $body-bold-weight;
}
}
@@ -174,7 +174,7 @@ body { padding: 1.5rem 3rem 1rem;
p {
- line-height: 1.5rem;
+ line-height: $body-line-height;
margin: .5rem 0;
}
@@ -184,15 +184,15 @@ body { outline-color $change-transition;
&:hover {
- opacity: .75;
+ opacity: 0.75;
}
}
- section {
+ div {
padding: 12px 0;
input {
- border: 1px solid var(--fg);
+ @include chrome-border(1px, var(--fg));
outline-offset: 3px;
padding: 0;
@@ -296,7 +296,7 @@ article > header { h1 {
line-height: 3rem;
- margin: 9px 0; // White space
+ margin: .5rem 0; // White space
}
img {
@@ -329,7 +329,7 @@ article > header { main {
p {
- line-height: 1.65rem;
+ line-height: $body-line-height;
}
}
@@ -355,7 +355,7 @@ code { @include letterpress(var(--rlpress));
display: inline-block;
- margin: 1.5rem 0 .75rem;
+ margin: 1.5rem 0 0.75rem;
}
}
{{ end }}
@@ -363,40 +363,31 @@ code { // WHITE SPACE
article {
- h2,
- h3 {
- margin: 2rem 0 1rem;
- }
- p {
- margin: 1.5rem 0;
+ @for $i from 2 through 6 {
+ h#{$i} {
+ margin: 1rem 0 ($body-line-height - 0.5rem); // or 2rem
+
+ // Allow spacing when using anchor links
+ padding: 1rem 0 0;
+
+ + p {
+ margin-top: 0;
+ }
+ }
}
-}
-
-%reset-top {
- margin-top: 0;
-}
-
-@for $i from 1 through 6 {
- h#{$i} + p {
- @extend %reset-top;
+
+ // Paragraph whitespace
+ > p {
+ margin: $body-line-height 0;
}
}
-%padding-top {
- padding-top: 1rem;
-}
-
-@for $i from 2 through 6 {
- h#{$i} {
- @extend %padding-top;
- }
-}
audio,
img,
video {
- margin: 1.8rem auto;
+ margin: 1.5rem auto;
}
@@ -537,7 +528,7 @@ li::before { display: block;
margin-top: 2.4rem;
- padding: 1rem 0 1.8rem;
+ padding: 1rem 0 1.5rem;
h2 {
margin: 0 0 2rem;
@@ -584,7 +575,7 @@ li::before { padding: 0 15px 4.5px;
vertical-align: top;
- font-size: .75rem;
+ font-size: 0.75rem;
text-transform: lowercase;
word-break: break-word;
@@ -704,6 +695,10 @@ article > pre, &:hover {
background: var(--accent);
color: var(--dtl);
+
+ a {
+ color: var(--dtl);
+ }
}
}
}
@@ -711,7 +706,7 @@ article > pre, .highlight > div table {
- padding: var(--lnhl-pad); // 0 24px;
+ //padding: var(--lnhl-pad); // 0 24px;
max-height: $box-max-height;
}
@@ -722,7 +717,8 @@ article > pre, article > pre,
.katex-display,
.highlight > pre {
- padding: var(--hl-pad);
+ //padding: var(--hl-pad);
+ padding: 1rem 1.5rem;
}
article > pre,
@@ -731,7 +727,7 @@ article > pre, .highlight > .chroma {
border: 1px solid $box-border;
- line-height: 1.5rem;
+ line-height: $body-line-height;
max-height: $box-max-height;
}
@@ -740,7 +736,7 @@ mark, p code,
li code {
border-radius: 2px;
- padding: 1px 3px;
+ padding: 0 3px;
}
li a {
@@ -846,8 +842,7 @@ img { display: block;
max-width: calc(100% - 2px);
- max-height: $box-max-height;
-
+
outline: 3px solid transparent;
transition:
@@ -856,41 +851,46 @@ img { filter $change-transition;
&.cover {
- border: 1px solid var(--fg);
+ @include chrome-border(1px, var(--fg));
object-fit: cover;
width: calc(100% - 2px);
}
+
+ &:not([src$='.svg']) {
+ max-height: $box-max-height;
+ }
}
+/*
article p > img {
display: block;
margin: 2rem auto;
max-width: calc(100% - 2px);
}
+*/
figure {
- margin: 1.8rem auto;
+ margin: 1.5rem auto;
img {
display: block;
margin: 0 auto;
- max-width: 90%;
}
figcaption {
font-size: .85rem;
text-align: center;
- margin: .75rem;
- line-height: 1.5rem;
+ margin: 0.75rem;
+ line-height: 1.25rem;
}
}
video {
display: block;
- max-width: 91%;
+ max-width: calc(100% - 2px);
max-height: $box-max-height;
outline: 3px solid transparent;
@@ -904,11 +904,6 @@ video { border-color: var(--accent);
outline-color: var(--accent);
}
-
- &.gifoid {
- margin: 3rem auto;
- max-width: 90%;
- }
}
audio {
@@ -919,7 +914,7 @@ audio { img,
video {
&.border {
- border: 1px solid var(--fg);
+ @include chrome-border(1px, var(--fg));
}
// NOTE
@@ -963,7 +958,7 @@ video { padding .2s ease;
&:hover {
- opacity: .75;
+ opacity: 0.75;
}
}
@@ -998,7 +993,7 @@ video { .footnotes ol,
article > ul,
article > ol {
- line-height: 1.5rem;
+ line-height: $body-line-height;
}
#TableOfContents > ol,
@@ -1061,7 +1056,7 @@ input[type=submit] { @include letterpress(var(--lpress));
&:hover {
- opacity: .75;
+ opacity: 0.75;
}
}
@@ -1199,7 +1194,7 @@ summary { color: var(--input-fg);
font-family: $body-font;
font-size: .9rem;
- line-height: 1.5rem;
+ line-height: $body-line-height;
transition:
background-color $change-transition,
@@ -1309,7 +1304,7 @@ summary { margin: 0 12px;
- font-size: .75rem;
+ font-size: 0.75rem;
font-weight: bold;
text-transform: uppercase;
@@ -1317,7 +1312,7 @@ summary { }
&:hover {
- opacity: .75;
+ opacity: 0.75;
}
}
}
@@ -1330,7 +1325,7 @@ summary { label {
display: block;
- line-height: 1.8rem;
+ line-height: 1.5rem;
}
input[name=name],
@@ -1364,7 +1359,7 @@ summary { }
input[type=submit] {
- font-size: .75rem;
+ font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: .05rem;
@@ -1477,9 +1472,9 @@ article { @include respond-above($mobile-breakpoint) {
html {
--blk-mg: 2.1rem 1.5rem;
- --hl-pad: 18px 24px; // 21px 24px;
+ //--hl-pad: 18px 24px; // 21px 24px;
- --lnhl-pad: 6px 24px;
+ //--lnhl-pad: 6px 24px;
}
// Not sure if I like this
@@ -1489,12 +1484,12 @@ article { align-items: center;
time {
- margin: 0 0 0 1.8rem;
+ margin: 0 0 0 1.5rem;
}
}
.footnotes {
- padding: 1rem .5rem 1.8rem;
+ padding: 1rem .5rem 1.5rem;
}
{{ if .Site.Params.Style.hideAnchors }}
@@ -1580,7 +1575,7 @@ dd { dt,
dd {
- line-height: 1.5rem;
+ line-height: $body-line-height;
}
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" diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 221f169..5c0991f 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -9,7 +9,7 @@ --> <!-- Get SVG bundle --> -{{ $svgBundleLink := (.Page.Scratch.Get "svgBundle").RelPermalink }} +{{ $svgBundleLink := (partialCached "svg-bundle" .) }} {{ $anchoredLinkLevels := seq 2 6 }} diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 6f9ae60..77af37a 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -2,8 +2,14 @@ {{ $altText := .Text }} {{ $class := .Page.Param "markupImgClass" }} -<!-- Get image processing options --> -{{ $imageProc := .Page.Scratch.Get "imageProc" }} + +<!-- Image processing configuration --> +{{ $imgProcConfig := false }} + +{{ with .Page }} + {{ $imgProcConfig = partialCached "utilities/image-processing-config" . }} +{{ end }} + <!-- Default image path --> {{ $imgPath := .Page.Param "imgPath" }} @@ -12,58 +18,71 @@ {{ $file = path.Join $imgPath $file }} {{ end }} -<!-- Assume file is local if found --> -{{ with $.Page.Resources.GetMatch $file }} +{{ $inputFile := .Page.Resources.GetMatch $file }} - <!-- If image width is equal or greater than X, process it --> - {{ if ge .Width $imageProc.markupAutoResizeWidth }} - {{ $mediumRes := (index $imageProc.mediumRes 0) }} +{{ with partial "utilities/image-processing" (dict "context" . "input" $inputFile "config" $imgProcConfig) }} - {{ $outputSet := slice }} - {{ $inputFile := . }} + {{ if .sets.default }} + + <picture> - {{ range $imageProc }} - {{ if reflect.IsSlice . }} - {{ $outputSet = $outputSet | append (printf "%s %s" (($inputFile.Resize (index . 0)).RelPermalink) (index . 1)) }} + <!-- Extra sets --> + {{ range .sets.extra }} + <source + srcset='{{ delimit .source ", " }}' + type="{{ .mediaType }}" + > {{ end }} - {{ end }} + + <!-- Default set --> + <source + srcset='{{ delimit .sets.default ", " }}' + type="{{ .default.MediaType }}" + > + + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + {{ with .default }} + src="{{ .RelPermalink }}" + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + /> + + </picture> - <img - {{ with $class }}class="{{ . }}"{{ end }} - loading="lazy" - srcset='{{ delimit $outputSet ", " }}' - src="{{ (.Resize $mediumRes).RelPermalink }}" - width="{{ (.Resize $mediumRes).Width }}" - height="{{ (.Resize $mediumRes).Height }}" - {{ with $altText }}alt="{{ . }}"{{ end }} - /> - {{ else }} - - {{ $processed := (.Resize (printf "%vx" .Width)) }} - - <img - {{ with $class }}class="{{ . }}"{{ end }} - loading="lazy" - src="{{ $processed.RelPermalink }}" - width="{{ .Width }}" - height="{{ .Height }}" - {{ with $altText }}alt="{{ . }}"{{ end }} - /> - - {{ end }} + + <!-- Avoid trying to get width and height from SVG files --> + {{ if .input }} + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + {{ with .input }} + src="{{ .RelPermalink }}" + {{ if ne .MediaType.SubType "svg" }} + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + /> + {{ else }} + + <!-- If local file isn't found, assume it's a remote file --> + {{ with ($.Destination | safeURL) }} + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + src="{{ . }}" + {{ with $altText }}alt="{{ . }}"{{ end }} + /> + {{ end }} + {{ end }} -{{ else }} - <!-- If local file isn't found, assume it's a remote file --> - {{ with (.Destination | safeURL) }} - - <img - {{ with $class }}class="{{ . }}"{{ end }} - loading="lazy" - src="{{ . }}" - {{ with $altText }}alt="{{ . }}"{{ end }} - /> - {{ end }} + {{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 93a0cb1..d973bfe 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,14 +1,4 @@ -<!-- - HACK - Set image processing options for render hooks - Currently here to avoid certain priority issues... ---> - -{{- .Scratch.Set "imageProc" (dict "highRes" (.Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes) "mediumRes" (.Site.Params.imageProc.mediumRes | default .Site.Data.default.imageProc.mediumRes) "lowRes" (.Site.Params.imageProc.lowRes | default .Site.Data.default.imageProc.lowRes) "markupAutoResizeWidth" (.Site.Params.imageProc.markupAutoResizeWidth | default .Site.Data.default.imageProc.markupAutoResizeWidth)) -}} - -<!-- Generate and set the SVG bundle --> -{{- $svgBundle := resources.Get "svg/bundle.svg" | resources.ExecuteAsTemplate "img/bundle.svg" . | minify | resources.Fingerprint "md5" -}} -{{- .Scratch.Set "svgBundle" $svgBundle -}} +{{- $svgBundle := partialCached "svg-bundle" . -}} <!DOCTYPE html> <html lang="{{ .Site.Language.Lang }}" data-mode="{{ if .Site.Params.Style.isDark }}dark{{ else }}light{{ end }}"> @@ -34,8 +24,8 @@ <!-- Search --> {{ if eq .Layout "search" }} - {{ $searchJS := resources.Get "js/search.js" | resources.ExecuteAsTemplate (printf "js/search.js" | relLangURL) . | minify | fingerprint }} - <script type="module" src="{{ $searchJS.Permalink }}" integrity="{{ $searchJS.Data.Integrity }}" crossorigin="anonymous"></script> + {{ $searchJS := resources.Get "js/search.js" | resources.ExecuteAsTemplate (print "js/search.js" | relLangURL) . | minify | fingerprint }} + <script async type="module" src="{{ $searchJS.Permalink }}" integrity="{{ $searchJS.Data.Integrity }}" crossorigin="anonymous"></script> {{ end }} <!-- KaTeX --> diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c8aac46..d69dee7 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,7 +1,7 @@ {{ define "main" }} - {{ $currentTitle := .Scratch.Get "currentTitle" }} - + {{ $heading := (partial "basic-tags" .).heading }} + <!-- Collect pages using the "search" layout --> {{ $searchPages := where .Site.RegularPages "Layout" "eq" "search" }} @@ -12,7 +12,7 @@ {{ partialCached "search-form" . .Layout }} {{ end }} - <h1>{{ $currentTitle }}</h1> + <h1>{{ $heading }}</h1> {{ if eq .Kind "taxonomy" }} {{ if eq .Type "categories" }} diff --git a/layouts/_default/search.html b/layouts/_default/search.html index 5aad01c..fc3e116 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -3,18 +3,27 @@ <main class="list"> {{ partialCached "search-form" . }} + + {{ $searchIndexLink := partialCached "search-index" . }} <h1>{{ .Title }}</h1> - <section id="search-info"> + <div id="search-info"> <!-- Info --> - </section> + </div> - <ul id="search-results" class="posts"> - <!-- x-template --> + <ul + id="search-results" + class="posts" + data-search-index="{{ $searchIndexLink }}" + data-lib-version="{{ .Site.Data.default.libs.fusejs }}" + /> + <!-- Results --> </ul> - <template id="search-results-template"><li><a class="btn"></a></li></template> + <template id="search-results-template"> + <li><a class="btn"></a></li> + </template> </main> diff --git a/layouts/_default/search.json.json b/layouts/_default/search.json.json deleted file mode 100644 index e401800..0000000 --- a/layouts/_default/search.json.json +++ /dev/null @@ -1,83 +0,0 @@ -{{- $stopWords := or .Params.stopWords .Site.Params.Search.stopWords -}} - -{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} -{{- $pages = where $pages "Params.noindex" "ne" true -}} - -{{- $lastIndex := (sub (len $pages) 1) -}} - -{{- $.Scratch.Add "index" slice -}} - -{{- range $index, $page := $pages -}} - - {{- $.Scratch.Delete "date" -}} - {{- $.Scratch.Delete "description" -}} - {{- $.Scratch.Delete "tags" -}} - - {{- if not .Date.IsZero -}} - {{- $.Scratch.Set "date" (.Date.Format "2006-01-02") -}} - {{- end -}} - - {{- if .Description -}} - {{- $.Scratch.Set "description" (.Description | emojify) -}} - {{- end -}} - - {{- if .Params.tags -}} - {{- $.Scratch.Set "tags" .Params.tags -}} - {{- end -}} - - {{- $scratch := newScratch -}} - - {{- $content := (.Content | replaceRE "(?s)<div class=\"highlight\".*?</div>" "" ) -}} - {{- $content := ($content | replaceRE "(?s)<p class=\"error\".*?</p>" "" ) -}} - {{- $content := ($content | replaceRE "<code.*?</code>" "" ) -}} - {{- $content := ($content | replaceRE "(http|https)\\S+" "" ) -}} - {{- $content := ($content | replaceRE "<!--(.|\n)+?-->" "" ) -}} - {{- $content := ($content | plainify | emojify | lower) -}} - {{- $content := (replaceRE "\"" "" $content) -}} - {{- $content := (replaceRE "“" "" $content) -}} - {{- $content := (replaceRE "”" "" $content) -}} - {{- $content := (replaceRE "\n+" " " $content) -}} - {{- $content := (replaceRE "\r+" " " $content) -}} - {{- $content := (replaceRE "\t+" " " $content) -}} - {{- $content := (replaceRE "<" "" $content) -}} - {{- $content := (replaceRE ">" "" $content) -}} - {{- $content := (replaceRE "…" "" $content) -}} - {{- $content := (replaceRE "\\(" "" $content) -}} - {{- $content := (replaceRE "\\)" "" $content) -}} - {{- $content := (replaceRE "\\. " " " $content) -}} - {{- $content := (replaceRE "\\," "" $content) -}} - {{- $content := (replaceRE "\\:" "" $content) -}} - {{- $content := (replaceRE "\\;" "" $content) -}} - {{- $content := (replaceRE "\\!" "" $content) -}} - {{- $content := (replaceRE "\\?" "" $content) -}} - {{- $content := (replaceRE "\\/" " " $content) -}} - {{- $content := (replaceRE " +" " " $content) -}} - {{- $content := (trim $content " ") -}} - {{- $words := (split $content " ") -}} - - - {{- range $words -}} - {{- $word := (.) -}} - {{- if and (not (in ($scratch.Get "seenWords") $word)) (ne (substr $word 0 1) $word) (not (in $stopWords $word)) -}} - {{- $.Scratch.Add "currentWords" (slice $word) -}} - {{- end -}} - {{- $scratch.Add "seenWords" (slice $word) -}} - {{- end -}} - - {{- $scratch.Delete "seenWords" -}} - - - {{- $filtered := ($.Scratch.Get "currentWords") -}} - - {{- if $filtered -}} - {{- $.Scratch.Set "uniqueContent" (delimit $filtered " ") -}} - {{- end -}} - - - {{- $.Scratch.Add "index" (dict "title" (.Title | emojify) "date" ($.Scratch.Get "date") "description" ($.Scratch.Get "description") "content" ($.Scratch.Get "uniqueContent") "permalink" .Permalink "tags" ($.Scratch.Get "tags")) -}} - - {{- $.Scratch.Delete "currentWords" -}} - -{{- end -}} - -{{- $.Scratch.Get "index" | jsonify -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3bb3a85..727e4cd 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,7 +7,7 @@ <h1>{{ .Title | emojify }}</h1> {{ if or .Params.categories .Params.tags }} - <section class="terms"> + <div class="terms"> <ul> {{- range sort (.GetTerms "categories") ".LinkTitle" "asc" -}} <li class="category"><a class="btn" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> @@ -16,7 +16,7 @@ <li><a class="btn" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li> {{- end -}} </ul> - </section> + </div> {{- end -}} {{ if not .Date.IsZero }} diff --git a/layouts/partials/basic-tags.html b/layouts/partials/basic-tags.html new file mode 100644 index 0000000..a1bd3cc --- /dev/null +++ b/layouts/partials/basic-tags.html @@ -0,0 +1,83 @@ +{{ $currentHeading := .Title | emojify }} +{{ $mainTitle := .Params.mainTitle | emojify }} + +{{ $titleSeparator := .Site.Params.titleSeparator }} + + +<!-- If 404 page --> +{{ if (eq .Kind "404") }} + + {{ $currentHeading = (.Site.Params.notFound.title | default .Site.Data.default.notFound.title) | emojify }} + +<!-- If post list --> +{{ else if (eq .Kind "section") }} + + {{ if gt .Paginator.TotalPages 1 }} + {{ $mainTitle = printf `%v, %v %v %v %v` .Title (T "page") .Paginator.PageNumber (T "of") .Paginator.TotalPages }} + {{ end }} + +<!-- If tags/categories list --> +{{ else if eq .Kind "term" }} + + {{ $currentTerm := false }} + + {{ if eq .Type "tags" }} + {{ $currentTerm = (T "tag") }} + {{ else }} + {{ $currentTerm = (T "category") }} + {{ end }} + + {{ $currentHeading = printf `%v: "%v"` $currentTerm .Title }} + + {{ with .Paginator }} + {{ if gt .TotalPages 1 }} + {{ $mainTitle = printf `%v: "%v", %v %v %v %v` $currentTerm $.Title (T "page") .PageNumber (T "of") .TotalPages }} + {{ else }} + {{ $mainTitle = printf `%v: "%v"` $currentTerm $.Title }} + {{ end }} + {{ end }} + +<!-- If tags/categories page --> +{{ else if eq .Kind "taxonomy" }} + + {{ if eq .Type "tags" }} + {{ $currentHeading = (T "tags") }} + {{ else }} + {{ $currentHeading = (T "categories") }} + {{ end }} + +<!-- If home page without content --> +{{ else if and (.IsHome) (not .Content) }} + + {{ $currentHeading = .Site.Title | emojify }} + +{{ end }} + + +{{ $currentDesc := .Params.Description | emojify }} + +{{ if .IsHome }} + {{ $currentDesc = .Site.Params.description | emojify }} +{{ else if and (ne .Kind "taxonomy") (eq .Type "tags") (not .Params.description) }} + {{ $currentDesc = (T "postsUnderTag" .) }} +{{ else if and (ne .Kind "taxonomy") (eq .Type "categories") (not .Params.description) }} + {{ $currentDesc = (T "postsUnderCategory" .) }} +{{ else if eq .Kind "taxonomy" }} + {{ $currentDesc = printf `%v %v.` (T "pageContaining") $currentHeading }} +{{ else if (eq .Kind "404") }} + {{ $currentDesc = (.Site.Params.notFound.description | default .Site.Data.default.notFound.description) | emojify }} +{{ end }} + + +{{ $currentTitle := $currentHeading }} + +{{ if and $titleSeparator (not .Params.disableTitleSeparator) }} + {{ if $mainTitle }} + {{ $currentTitle = printf `%v %v %v` $mainTitle $titleSeparator .Site.Title }} + {{ else }} + {{ $currentTitle = printf `%v %v %v` $currentHeading $titleSeparator .Site.Title }} + {{ end }} +{{ end }} + + +{{ return (dict "heading" $currentHeading "description" $currentDesc "title" $currentTitle) }} diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html index 4e741b6..593c4e0 100644 --- a/layouts/partials/cover.html +++ b/layouts/partials/cover.html @@ -1,35 +1,82 @@ {{ $file := .Params.cover }} {{ $altText := .Params.coverAlt }} -<!-- Image processing options --> -{{ $imageProc := (dict "highRes" (.Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes) "mediumRes" (.Site.Params.imageProc.mediumRes | default .Site.Data.default.imageProc.mediumRes) "lowRes" (.Site.Params.imageProc.lowRes | default .Site.Data.default.imageProc.lowRes)) }} +{{ $destination := $file }} + + +<!-- Image processing configuration --> +{{ $imgProcConfig := partialCached "utilities/image-processing-config" . }} + <!-- Default image path --> {{ $imgPath := .Page.Param "imgPath" }} {{ if $imgPath }} - {{ $file = path.Join $imgPath $file }} + {{ $file = path.Join $imgPath .Params.cover }} {{ end }} -{{ with $.Page.Resources.GetMatch $file }} - - {{ $mediumRes := (index $imageProc.mediumRes 0) }} +{{ $inputFile := .Page.Resources.GetMatch $file }} - {{ $outputSet := slice }} - {{ $inputFile := . }} - - {{ range $imageProc }} - {{ $outputSet = $outputSet | append (printf "%s %s" (($inputFile.Resize (index . 0)).RelPermalink) (index . 1)) }} - {{ end }} - <img - class="cover" - loading="lazy" - srcset='{{ delimit $outputSet ", " }}' - src="{{ (.Resize $mediumRes).RelPermalink }}" - width="{{ (.Resize $mediumRes).Width }}" - height="{{ (.Resize $mediumRes).Height }}" - {{ with $altText }}alt="{{ . }}"{{ end }} - /> +{{ with partial "utilities/image-processing" (dict "context" . "input" $inputFile "config" $imgProcConfig) }} + {{ if .sets.default }} + + <picture> + + <!-- Extra sets --> + {{ range .sets.extra }} + <source + srcset='{{ delimit .source ", " }}' + type="{{ .mediaType }}" + > + {{ end }} + + <!-- Default set --> + <source + srcset='{{ delimit .sets.default ", " }}' + type="{{ .default.MediaType }}" + > + + <img + class="cover" + {{ with .default }} + src="{{ .RelPermalink }}" + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + > + + </picture> + + {{ else }} + + <!-- Avoid trying to get width and height from SVG files --> + {{ if .input }} + <img + class="cover" + {{ with .input }} + src="{{ .RelPermalink }}" + {{ if ne .MediaType.SubType "svg" }} + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + > + {{ else }} + + <!-- If local file isn't found, assume it's a remote file --> + {{ with ($destination | safeURL) }} + <img + class="cover" + src="{{ . }}" + {{ with $altText }}alt="{{ . }}"{{ end }} + > + {{ end }} + {{ end }} + + {{ end }} + {{ end }} diff --git a/layouts/partials/footer-opt.html b/layouts/partials/footer-opt.html index d31a4d9..2d30428 100644 --- a/layouts/partials/footer-opt.html +++ b/layouts/partials/footer-opt.html @@ -1,5 +1,5 @@ <!-- Get SVG bundle --> -{{ $svgBundleLink := (.Page.Scratch.Get "svgBundle").RelPermalink }} +{{ $svgBundleLink := (partialCached "svg-bundle" .) }} <!-- Get default accent colors --> {{ $defaultLightAccent := .Site.Params.Style.lightAccent | default .Site.Data.default.style.lightAccent }} @@ -7,9 +7,9 @@ {{ $allAccentColors := union (slice $defaultLightAccent $defaultDarkAccent) .Site.Params.Style.presets }} -<section class="req-js"> +<div class="req-js"> <button class="outline-dashed" title="{{ T "changeMode" }}"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use xlink:href="{{ $svgBundleLink }}#adjust"/></svg></button><input class="outline-dashed" type="color" list="presets" value="{{ if .Site.Params.Style.isDark }}{{ $defaultDarkAccent }}{{ else }}{{ $defaultLightAccent }}{{ end }}" title="{{ T "changeAccent" }}" aria-label="{{ T "changeAccent" }}"><datalist id="presets">{{ range $allAccentColors }}<option value="{{ . }}">{{ end }}</datalist> -</section> +</div> <!-- noscript notice --> {{ if .Site.Params.hasNoscriptNotice }} diff --git a/layouts/partials/head-cover.html b/layouts/partials/head-cover.html new file mode 100644 index 0000000..f500160 --- /dev/null +++ b/layouts/partials/head-cover.html @@ -0,0 +1,79 @@ +{{ $file := .Params.cover }} +{{ $coverAlt := .Params.coverAlt | default .Site.Params.coverAlt }} + + +<!-- Image processing configuration --> +{{ $imgProcConfig := partialCached "utilities/image-processing-config" . }} + +{{ $resize := $imgProcConfig.autoResize }} + + +<!-- Default image path --> +{{ $imgPath := .Page.Param "imgPath" }} + +{{ if $imgPath }} + {{ $file = path.Join $imgPath .Params.cover }} +{{ end }} + +{{ $inputFile := false }} + +{{ if and .Site.Params.cover (not .Params.cover) }} + {{ $inputFile = resources.Get .Site.Params.cover }} +{{ else }} + {{ $inputFile = .Page.Resources.GetMatch $file }} +{{ end }} + + +<!-- Avoid trying to convert unsupported formats (GIF, SVG, etc) --> +{{ $supportedFormats := (slice "jpeg" "png" "tiff") }} + + +<!-- Initialization --> +{{ $fallbackOptions := false }} + +{{ $openGraphImage := false }} +{{ $twitterImage := false }} + +{{ $schemaCover := false }} + + +{{ if and $inputFile $resize }} + + {{ if in $supportedFormats ($inputFile.MediaType.SubType) }} + + <!-- Generate images for Open Graph, Twitter Cards and also Schema --> + {{ with $inputFile }} + + <!-- Make sure "tiff" is converted to a format with better support --> + {{ if eq .MediaType.SubType "tiff" }} + {{ $fallbackOptions = $imgProcConfig.fallbackOptions }} + {{ end }} + + {{ $openGraphImage = (.Fill (printf "%s %s" $imgProcConfig.openGraphFillOptions $fallbackOptions)) }} + {{ $twitterImage = (.Fill (printf "%s %s" $imgProcConfig.twitterFillOptions $fallbackOptions)) }} + + {{ end }} + + {{ if and (in .Site.Params.mainSections .Section) (not .Params.sitemapExclude) }} + {{ $schemaCover = (slice ($twitterImage.Permalink) ($openGraphImage.Permalink)) }} + {{ end }} + + {{ end }} + +{{ else }} + + {{ with $inputFile }} + + {{ $openGraphImage = . }} + {{ $twitterImage = $openGraphImage }} + + {{ if and (in $.Site.Params.mainSections $.Section) (not $.Params.sitemapExclude) }} + {{ $schemaCover = (slice $inputFile.Permalink) }} + {{ end }} + + {{ end }} + + +{{ end }} + +{{ return (dict "openGraphImage" $openGraphImage "coverAlt" $coverAlt "twitterImage" $twitterImage "schemaCover" $schemaCover) }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 78cee39..091d6c3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -3,103 +3,14 @@ <meta name="generator" content="Hugo {{ hugo.Version }}"> <meta name="theme" content="Color Your World -- gitlab.com/rmaguiar/hugo-theme-color-your-world"> -<!-- I'm 99% sure there's a smarter way of doing it but whatever --> -{{ $currentTitle := .Title | emojify }} -{{ $mainTitle := .Params.mainTitle | emojify }} - - -{{ $titleSeparator := .Site.Params.titleSeparator }} - - -{{ if (eq .Kind "404") }} - - <!-- If 404 page --> - {{ $currentTitle = .Site.Params.notFound.title | emojify | default .Site.Data.default.notFound.title }} - -{{ else if (eq .Kind "section") }} - - <!-- If post list --> - {{ if gt .Paginator.TotalPages 1 }} - {{ $mainTitle = printf `%s, %s %s %s %s` .Title (T "page") (string .Paginator.PageNumber) (T "of") (string .Paginator.TotalPages) }} - {{ end }} - -{{ else if eq .Kind "term" }} - - {{ $currentTerm := "" }} - - {{ if eq .Type "tags" }} - {{ $currentTerm = (T "tag") }} - {{ else }} - {{ $currentTerm = (T "category") }} - {{ end }} - - {{ $currentTitle = printf `%s: "%s"` $currentTerm .Title }} - - {{ with .Paginator }} - {{ if gt .TotalPages 1 }} - {{ $mainTitle = printf `%s: "%s", %s %s %s %s` $currentTerm $.Title (T "page") (string .PageNumber) (T "of") (string .TotalPages) }} - {{ else }} - {{ $mainTitle = printf `%s: "%s"` $currentTerm $.Title }} - {{ end }} - {{ end }} - -{{ else if eq .Kind "taxonomy" }} - - {{ if eq .Type "tags" }} - {{ $currentTitle = (T "tags") }} - {{ else }} - {{ $currentTitle = (T "categories") }} - {{ end }} - -{{ else if and (.IsHome) (not .Content) }} - - <!-- If home page without content --> - {{ $currentTitle = .Site.Title | emojify }} - -{{ end }} - - -{{ $currentDesc := .Params.Description | emojify }} - -{{ if .IsHome }} - {{ $currentDesc = .Site.Params.description | emojify }} -{{ else if and (ne .Kind "taxonomy") (eq .Type "tags") (not .Params.description) }} - {{ $currentDesc = (T "postsUnderTag" .) }} -{{ else if and (ne .Kind "taxonomy") (eq .Type "categories") (not .Params.description) }} - {{ $currentDesc = (T "postsUnderCategory" .) }} -{{ else if eq .Kind "taxonomy" }} - {{ $currentDesc = printf `%s %s.` (T "pageContaining") ($currentTitle | lower) }} -{{ else if (eq .Kind "404") }} - {{ $currentDesc = .Site.Params.notFound.description | emojify | default .Site.Data.default.notFound.description }} -{{ end }} - - -<!-- Set current title --> -{{ .Scratch.Set "currentTitle" $currentTitle }} - - <!-- Beginning of the SEO madness --> +{{- $basicTags := partial "basic-tags" . -}} -<title> - {{- if and $titleSeparator (not .Params.disableTitleSeparator ) -}} - {{ if $mainTitle }} - {{- $mainTitle = printf `%s %s %s` $mainTitle $titleSeparator .Site.Title -}} - {{ else }} - {{- $mainTitle = printf `%s %s %s` $currentTitle $titleSeparator .Site.Title -}} - {{ end }} - {{- end -}} - - {{- if $mainTitle -}} - {{- $mainTitle -}} - {{ else }} - {{- $currentTitle -}} - {{- end -}} -</title> - +<title>{{ $basicTags.title }}</title> {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }} -{{ with $currentDesc }}<meta name="description" content="{{ . }}">{{ end }} +{{ with $basicTags.description }}<meta name="description" content="{{ . }}">{{ end }} <meta name="robots" content="{{ if and (ne .Kind "404") (ne .Params.noindex true) }}index follow{{ else }}noindex follow{{ end }}"> @@ -133,8 +44,8 @@ <!-- Open Graph / Twitter Card --> <meta property="og:site_name" content="{{ .Site.Title }}"> -<meta property="og:title" content="{{ $currentTitle }}"> -{{ with $currentDesc }}<meta property="og:description" content="{{ . }}">{{ end }} +<meta property="og:title" content="{{ $basicTags.heading }}"> +{{ with $basicTags.description }}<meta property="og:description" content="{{ . }}">{{ end }} {{- if ne .Kind "404" }} <meta property="og:url" content="{{ .Permalink }}"> @@ -142,53 +53,26 @@ -<!-- Image processing options --> -{{ $highRes := .Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes }} +<!-- Generate images for Open Graph, Twitter Cards and Schema --> +{{ $cover := partial "head-cover" . }} -<!-- Default image path --> -{{ $imgPath := .Page.Param "imgPath" }} -<!-- Generate images for Open Graph, Twitter Cards and also Schema.org --> -{{- if .Params.cover }} +{{ with $cover.openGraphImage }} + <meta property="og:image" content="{{ .Permalink }}"> + <meta property="og:image:width" content="{{ .Width }}"> + <meta property="og:image:height" content="{{ .Height }}"> +{{ end }} - {{ $file := .Params.cover }} +{{ with $cover.coverAlt }} + <meta property="og:image:alt" content="{{ . }}"> +{{ end }} + +{{ with $cover.twitterImage }} + <meta name="twitter:card" content="summary_large_image"> + <meta name="twitter:image" content="{{ .Permalink }}"> +{{ end }} - {{ if $imgPath }} - {{ $file = path.Join $imgPath $file }} - {{ end }} - {{- with .Resources.GetMatch $file }} - <meta property="og:image" content="{{ (.Fill "1200x630").Permalink }}"> - <meta property="og:image:width" content="1200"> - <meta property="og:image:height" content="630"> - {{ with $.Params.coverAlt }} - <meta property="og:image:alt" content="{{ . }}"> - {{ end }} - <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:image" content="{{ (.Fill "1280x640").Permalink }}"> - - {{ if and (in $.Site.Params.mainSections $.Section) (not .Params.sitemapExclude) }} - {{ $.Scratch.Set "schemaCover" (slice ((.Fill "1280x640").Permalink) ((.Fill "1200x630").Permalink) ((.Resize (index $highRes 0)).Permalink)) }} - {{ end }} - - {{ end -}} -{{ else if .Site.Params.cover }} - {{ with resources.Get (.Site.Params.cover | default "img/cover.jpg") }} - <meta property="og:image" content="{{ (.Fill "1200x630").Permalink }}"> - <meta property="og:image:width" content="1200"> - <meta property="og:image:height" content="630"> - {{ with $.Site.Params.coverAlt }} - <meta property="og:image:alt" content="{{ . }}"> - {{ end }} - <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:image" content="{{ (.Fill "1280x640").Permalink }}"> - - {{ if and (in $.Site.Params.mainSections $.Section) (not .Params.sitemapExclude) }} - {{ $.Scratch.Set "schemaCover" (slice ((.Fill "1280x640").Permalink) ((.Fill "1200x630").Permalink) ((.Resize (index $highRes 0)).Permalink)) }} - {{ end }} - - {{ end }} -{{ end -}} <!-- More social crap --> {{ if and (in .Site.Params.mainSections .Section) (.IsPage) (not .Params.sitemapExclude) }} @@ -248,37 +132,37 @@ <meta name="apple-mobile-web-app-status-bar-style" content="default"> -<!-- Reduce repetition... --> +<!-- DRY --> {{- $centralized := .Site.Params.Social.Centralized -}} {{- $decentralized := .Site.Params.Social.Decentralized -}} <!-- Generate array with social profiles --> {{- $sameAs := slice -}} -{{ if .Site.Params.Social }} - {{ range .Site.Data.social }} +{{- if .Site.Params.Social -}} + {{- range .Site.Data.social -}} - {{ $currentEntry := .entry }} - {{ $currentBase := .base }} + {{- $currentEntry := .entry -}} + {{- $currentBase := .base -}} - {{ if not .decentralized }} + {{- if not .decentralized -}} - {{ with (index $centralized $currentEntry) }} - {{ $sameAs = $sameAs | append (printf "%s%s" $currentBase (index . 0)) }} - {{ end }} + {{- with (index $centralized $currentEntry) -}} + {{- $sameAs = $sameAs | append (printf "%s%s" $currentBase (index . 0)) -}} + {{- end -}} - {{ else }} + {{- else -}} - {{ if (index $decentralized $currentEntry) }} - {{ range (index $decentralized $currentEntry) }} - {{ $sameAs = $sameAs | append (index . 0) }} - {{ end }} - {{ end }} + {{- if (index $decentralized $currentEntry) -}} + {{- range (index $decentralized $currentEntry) -}} + {{- $sameAs = $sameAs | append (index . 0) -}} + {{- end -}} + {{- end -}} - {{ end }} + {{- end -}} - {{ end }} -{{ end }} + {{- end -}} +{{- end -}} <!-- Schema Markup / Structured Data --> @@ -300,14 +184,14 @@ "@type": "Article", "mainEntityOfPage": { "@type": "WebSite", - "@id": "{{ .Site.BaseURL }}" + "@id": {{ .Site.BaseURL }} }, - "headline": {{ $currentTitle }}, - "description": {{ $currentDesc }}, - {{ with .Scratch.Get "schemaCover" }}"image": {{ . }},{{ end }} - "url": "{{ .Permalink }}", + "headline": {{ $basicTags.heading }}, + "description": {{ $basicTags.description }}, + {{ with $cover.schemaCover }}"image": {{ . }},{{ end }} + "url": {{ .Permalink }}, "inLanguage": "{{ .Site.Language.Lang }}", - "datePublished": "{{ .PublishDate.Format "2006-01-02" | safeHTML }}", + {{ with .PublishDate }}"datePublished": "{{ .Format "2006-01-02" | safeHTML }}",{{ end }} {{ with .Lastmod }}"dateModified": "{{ .Format "2006-01-02" | safeHTML }}",{{ end }} "wordCount" : "{{ .WordCount }}", "publisher": { @@ -327,7 +211,7 @@ { "@context": "https://schema.org", "@type": "WebSite", - "url": "{{ .Site.BaseURL }}", + "url": {{ .Site.BaseURL }}, "inLanguage": "{{ .Site.Language.Lang }}", "name": {{ .Site.Title }}, "description": {{ .Site.Params.description | emojify }}, @@ -350,7 +234,8 @@ <!-- Preload search index --> {{ if eq .Layout "search" }} - <link rel="preload" href="index.json" as="fetch" crossorigin="anonymous"> + {{ $searchIndexLink := partialCached "search-index" . }} + <link rel="preload" href="{{ $searchIndexLink }}" as="fetch" crossorigin="anonymous"> {{ end }} diff --git a/layouts/partials/katex-font-preload.html b/layouts/partials/katex-font-preload.html index 988bab1..b039ef2 100644 --- a/layouts/partials/katex-font-preload.html +++ b/layouts/partials/katex-font-preload.html @@ -4,7 +4,7 @@ Adjust as necessary --> -{{ $katexVersion := "0.15.3" }} +{{ $katexVersion := .Site.Data.default.libs.katex }} <link rel="preload" href="/libs/katex@{{ $katexVersion }}/dist/fonts/KaTeX_Main-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous"> <link rel="preload" href="/libs/katex@{{ $katexVersion }}/dist/fonts/KaTeX_Math-Italic.woff2" as="font" type="font/woff2" crossorigin="anonymous"> diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html index c829c70..d161a1e 100644 --- a/layouts/partials/katex.html +++ b/layouts/partials/katex.html @@ -1,5 +1,5 @@ <!-- KaTeX -->
-{{ $katexVersion := "0.15.3" }}
+{{ $katexVersion := .Site.Data.default.libs.katex }}
{{ $katexCSS := resources.Get (printf "libs/katex@%s/dist/katex.css" $katexVersion) | minify | fingerprint }}
<link rel="stylesheet" href="{{ $katexCSS.Permalink }}" integrity="{{ $katexCSS.Data.Integrity }}" crossorigin="anonymous">
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 8445cc1..93e4b10 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -1,5 +1,5 @@ <!-- Get SVG bundle --> -{{ $svgBundleLink := (.Scratch.Get "svgBundle").RelPermalink }} +{{ $svgBundleLink := (partialCached "svg-bundle" .) }} {{ $pag := .Paginator }} @@ -47,7 +47,7 @@ <!-- Page numbers. --> {{ range $pag.Pagers }} - {{ $.Scratch.Set "pageNumberFlag" false }} + {{ $pageNumberFlag := false }} <!-- Advanced page numbers. --> {{ if gt $pag.TotalPages $maxLinks }} @@ -58,7 +58,7 @@ <!-- If the current loop page is less than max_links. --> {{ if le .PageNumber $maxLinks }} - {{ $.Scratch.Set "pageNumberFlag" true }} + {{ $pageNumberFlag = true }} {{ end }} @@ -68,7 +68,7 @@ <!-- If the current loop page is greater than total pages minus $maxLinks --> {{ if gt .PageNumber (sub $pag.TotalPages $maxLinks) }} - {{ $.Scratch.Set "pageNumberFlag" true }} + {{ $pageNumberFlag = true }} {{ end }} @@ -76,7 +76,7 @@ {{ else }} {{ if and ( ge .PageNumber (sub $pag.PageNumber $adjacentLinks) ) ( le .PageNumber (add $pag.PageNumber $adjacentLinks) ) }} - {{ $.Scratch.Set "pageNumberFlag" true }} + {{ $pageNumberFlag = true }} {{ end }} {{ end }} @@ -85,12 +85,12 @@ <!-- Simple page numbers. --> {{ else }} - {{ $.Scratch.Set "pageNumberFlag" true }} + {{ $pageNumberFlag = true }} {{ end }} <!-- Output page numbers. --> - {{ if eq ($.Scratch.Get "pageNumberFlag") true }} + {{ if eq $pageNumberFlag true }} <li {{ if eq . $pag }}class="current"{{ end }}> {{ if eq . $pag }} <p>{{ .PageNumber }}</p> diff --git a/layouts/partials/processed-content.html b/layouts/partials/processed-content.html index 8acb7ff..41b68a7 100644 --- a/layouts/partials/processed-content.html +++ b/layouts/partials/processed-content.html @@ -26,17 +26,13 @@ https://github.com/gohugoio/hugo/pull/8568
So... this is now a hack to a hack.
-
- TODO
- Also, I need to fix the "additional" tabindexes in code fences
- with line numbers (.lntd > .chroma).
-->
<!-- Get SVG bundle -->
-{{ $svgBundleLink := (.Scratch.Get "svgBundle").RelPermalink }}
+{{ $svgBundleLink := (partialCached "svg-bundle" .) }}
<!-- i18n -->
-{{ $references := `(<section class="footnotes" role="doc-endnotes">)` }}
+{{ $references := `(<(?:section|div) class="footnotes" role="doc-endnotes">)` }}
{{ $seeFootnotes := `(class="footnote-ref")` }}
{{ $returnToText := `(class="footnote-backref")` }}
@@ -56,7 +52,7 @@ <!-- Wrap tables to make use of overflow-x property (plus the tabindex thing) -->
{{ $table := `(<table>(?:.|\n)+?</table>)` }}
-{{ $improvedTable := printf `<section class="scroll" tabindex="0"> ${1} </section>` }}
+{{ $improvedTable := printf `<div class="scroll" tabindex="0"> ${1} </div>` }}
<!-- Replace the inline "padding:0" present if using the default Chroma -->
@@ -76,14 +72,23 @@ {{ $improvedFootnoteReturnLink = printf `${1}<svg transform="rotate(180) translate(0 -1)" aria-hidden="true"><use xlink:href="%s#caret-down"/></svg>${2}` $svgBundleLink }}
{{ end }}
+
+<!-- Remove extra tab indexes (see at the top) -->
+{{ $extraTabIndex := `(?:(<td class="lntd">(?:.|\n)+?<pre) tabindex="0" (class="chroma">))` }}
+
+{{ $trimmedExtraTabIndex := printf `${1} ${2}` }}
+
+
<!--
- This is doing 5 things right now (or is it):
+ This is doing 6 things right now (or is it):
* Adding "tabindex=0" to native table and code fences;
* Making tables scrollable;
* Localizing some text;
* Adding a "h2" to footnotes;
- * Changing the default inline style for default Chroma.
+ * Changing the default inline style for default Chroma;
+ * Removing the "extra" tabindexes in code fences
+ with line numbers (.lntd > .chroma).
-->
-{{ .Content | replaceRE $table $improvedTable | replaceRE $highlightCodeBlock $labeledHighlightCodeBlock | replaceRE $indentedCodeBlock $labeledIndentedCodeBlock | replaceRE $seeFootnotes $translatedSeeFootnotes | replaceRE $returnToText $translatedReturnToText | replaceRE $references $translatedReferences | replaceRE $footnoteReturnLink $improvedFootnoteReturnLink | replaceRE $highlightPadding $tweakedHighlightPadding | safeHTML }}
+{{ .Content | replaceRE $table $improvedTable | replaceRE $highlightCodeBlock $labeledHighlightCodeBlock | replaceRE $indentedCodeBlock $labeledIndentedCodeBlock | replaceRE $seeFootnotes $translatedSeeFootnotes | replaceRE $returnToText $translatedReturnToText | replaceRE $references $translatedReferences | replaceRE $footnoteReturnLink $improvedFootnoteReturnLink | replaceRE $highlightPadding $tweakedHighlightPadding | replaceRE $extraTabIndex $trimmedExtraTabIndex | safeHTML }}
diff --git a/layouts/partials/search-form.html b/layouts/partials/search-form.html index 855b7bf..1c31043 100644 --- a/layouts/partials/search-form.html +++ b/layouts/partials/search-form.html @@ -1,5 +1,5 @@ <!-- Get SVG bundle --> -{{ $svgBundleLink := (.Scratch.Get "svgBundle").RelPermalink }} +{{ $svgBundleLink := (partialCached "svg-bundle" .) }} <!-- Assume that the first page in a collection with pages @@ -11,7 +11,7 @@ {{ $maxLength := .Site.Params.Search.maxLength | default .Site.Data.default.search.maxLength }} -<section class="req-js search-box"> +<div class="req-js search-box"> {{ if eq .Layout "search" }} <form role="search"> {{ else }} @@ -20,4 +20,4 @@ <label class="label-form" for="search-input">{{ T "searchLabel" }}</label><input class="input-text" type="search" id="search-input" title='{{ T "searchInput" (dict "minLength" $minLength "maxLength" $maxLength) }}' name="q" {{ with .Site.Params.Search.placeholder }}placeholder="{{ . }}"{{ end }} minlength="{{ $minLength }}" maxlength="{{ $maxLength }}" pattern="^[\S].*" required><button aria-label="{{ T "searchAriaButton" }}" class="btn outline-dashed" type="submit"><svg aria-hidden="true"><use xlink:href="{{ $svgBundleLink }}#search"/></svg></button> </form> <hr> -</section> +</div> diff --git a/layouts/partials/search-index.html b/layouts/partials/search-index.html new file mode 100644 index 0000000..76ba1c7 --- /dev/null +++ b/layouts/partials/search-index.html @@ -0,0 +1,3 @@ +{{ $searchIndex := resources.Get "json/search.json" | resources.ExecuteAsTemplate (printf "%s/index.json" .RelPermalink) . | resources.Fingerprint "md5" }} + +{{ return (path.Base $searchIndex.RelPermalink) }} diff --git a/layouts/partials/svg-bundle.html b/layouts/partials/svg-bundle.html new file mode 100644 index 0000000..b9b5a92 --- /dev/null +++ b/layouts/partials/svg-bundle.html @@ -0,0 +1,5 @@ +<!-- Generate and set the SVG bundle --> +{{- $svgBundle := resources.Get "svg/bundle.svg" | resources.ExecuteAsTemplate "img/bundle.svg" . | minify | resources.Fingerprint "md5" -}} +{{- $svgBundleLink := $svgBundle.RelPermalink -}} + +{{- return $svgBundleLink -}} diff --git a/layouts/partials/utilities/image-processing-config.html b/layouts/partials/utilities/image-processing-config.html new file mode 100644 index 0000000..586755b --- /dev/null +++ b/layouts/partials/utilities/image-processing-config.html @@ -0,0 +1,6 @@ +{{- $custom := .Site.Params.imageProcessing -}} +{{- $default := .Site.Data.default.imageProcessing -}} + +{{- $imageProc := (dict "autoResize" ($custom.autoResize | default $default.autoResize) "fallbackOptions" ($custom.fallbackOptions | default $default.fallbackOptions) "openGraphFillOptions" ($custom.openGraphFillOptions | default $default.openGraphFillOptions) "twitterFillOptions" ($custom.twitterFillOptions | default $default.twitterFillOptions) "sizes" ($custom.sizes | default $default.sizes) "extraFormats" ($custom.extraFormats | default $default.extraFormats)) -}} + +{{- return $imageProc -}} diff --git a/layouts/partials/utilities/image-processing.html b/layouts/partials/utilities/image-processing.html new file mode 100644 index 0000000..e9cea68 --- /dev/null +++ b/layouts/partials/utilities/image-processing.html @@ -0,0 +1,114 @@ +{{ $inputFile := .input }} +{{ $resize := .resize }} + +{{ $imgProcConfig := .config }} + + +<!-- Avoid trying to convert unsupported formats (GIF, SVG, etc) --> +{{ $supportedFormats := (slice "jpeg" "png" "tiff") }} + + +<!-- Initialize --> +{{ $defaultImage := false }} +{{ $fallbackOptions := false }} + +{{ $outputSetDefault := slice }} +{{ $outputSetExtra := slice }} + + +<!-- + If resize parameter isn't found, get the default value + Accept boolean AND string +--> +{{ if and (not $resize) (ne $resize false) }} + {{ $resize = $imgProcConfig.autoResize }} +{{ end }} + + +<!-- + Assume file is local if found + And again, make sure "false" (string) is also accepted +--> +{{ if and $inputFile (in $supportedFormats ($inputFile.MediaType.SubType)) $resize (ne $resize "false") }} + + <!-- Make sure "tiff" is always converted to "jpeg" or "png" --> + {{ if eq $inputFile.MediaType.SubType "tiff" }} + {{ $fallbackOptions = $imgProcConfig.fallbackOptions }} + {{ end }} + + {{ range $index, $el := $imgProcConfig.sizes }} + + <!-- Avoid resize images that are too small --> + {{ if ge $inputFile.Width .minWidth }} + + <!-- Each item corresponds to an image file and its size descriptor --> + {{ $outputSetDefault = $outputSetDefault | append (printf "%v %v" (($inputFile.Resize (printf "%v %v" .resizeOptions $fallbackOptions)).RelPermalink) .descriptor) }} + + <!-- Use the smallest image size available as the default image --> + {{ if (eq $index (sub (len $imgProcConfig.sizes) 1)) }} + {{ $defaultImage = ($inputFile.Resize (printf "%v %v" .resizeOptions $fallbackOptions)) }} + {{ end }} + + {{ end }} + + {{ end }} + + <!-- Generate extra source sets --> + {{ range $imgProcConfig.extraFormats }} + + <!-- Make sure the Hugo version supports the format --> + {{ if (ge hugo.Version .minVersion) }} + + {{ $formatOptions := .formatOptions }} + {{ $currentItems := slice }} + + {{ range $imgProcConfig.sizes }} + {{ if ge $inputFile.Width .minWidth }} + + <!-- Each item corresponds to an image file and its size descriptor --> + {{ $currentItems = $currentItems | append (printf "%v %v" (($inputFile.Resize (printf "%v %v" .resizeOptions $formatOptions)).RelPermalink) .descriptor) }} + + {{ end }} + {{ end }} + + <!-- Append current items and media type --> + {{ $outputSetExtra = $outputSetExtra | append (dict "source" $currentItems "mediaType" .mediaType) }} + + {{ end }} + {{ end }} + + + + <!-- + If even the smallest size option available is still + bigger than the original image size, make its + original size the default size + --> + {{ if not $defaultImage }} + + <!-- Reset and reuse --> + {{ $outputSetDefault = slice }} + {{ $outputSetExtra = slice }} + + {{ $defaultImage = ($inputFile.Resize (printf "%vx" $inputFile.Width)) }} + + {{ $outputSetDefault = $outputSetDefault | append $defaultImage.RelPermalink }} + + {{ range $imgProcConfig.extraFormats }} + + {{ $formatOptions := .formatOptions }} + + {{ if (ge hugo.Version .minVersion) }} + + {{ $currentItem := ($inputFile.Resize (printf "%vx %v" $inputFile.Width $formatOptions)) }} + + <!-- Append current item and media type --> + {{ $outputSetExtra = $outputSetExtra | append (dict "source" (slice $currentItem.RelPermalink) "mediaType" .mediaType) }} + + {{ end }} + {{ end }} + {{ end }} + +{{ end }} + +{{ return (dict "input" $inputFile "default" $defaultImage "sets" (dict "default" $outputSetDefault "extra" $outputSetExtra)) }} diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index a776be4..b99d3d5 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -1,10 +1,9 @@ <!-- Usage: - figure "weird_cat.jpg" "Something that can (or not) be a cat." - figure src="weird_cat.jpg" alt="Something that can (or not) be a cat." - figure class="border" src="weird_cat.jpg" alt="Something that can (or not) be a cat." - figure "weird_cat.jpg" "Something that can (or not) be a cat." "border" - figure class="border" src="weird_cat.jpg" caption="Something that can (or not) be a cat." alt="Ask someone blind if a caption and alt text are the same thing." + img "weird_cat.jpg" "Something that can (or not) be a cat." + img src="weird_cat.jpg" alt="Something that can (or not) be a cat." + img class="border" src="weird_cat.jpg" alt="Something that can (or not) be a cat." resize=false + img "weird_cat.jpg" "Something that can (or not) be a cat." "border" false Default available classes: border @@ -12,12 +11,16 @@ --> {{ $file := .Get "src" | default (.Get 0) }} -{{ $caption := .Get "caption" | default (.Get 1) | markdownify }} +{{ $caption := (.Get "caption" | default (.Get 1)) | markdownify }} {{ $class := .Get "class" | default (.Get 2) }} -{{ $alt := .Get "alt" | default $caption }} +{{ $resize := .Get "resize" | default (.Get 3) }} +{{ $altText := .Get "alt" | default $caption }} -<!-- Image processing options --> -{{ $imageProc := (dict "highRes" (.Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes) "mediumRes" (.Site.Params.imageProc.mediumRes | default .Site.Data.default.imageProc.mediumRes) "lowRes" (.Site.Params.imageProc.lowRes | default .Site.Data.default.imageProc.lowRes)) }} +{{ $destination := $file }} + + +<!-- Image processing configuration --> +{{ $imgProcConfig := partialCached "utilities/image-processing-config" . }} <!-- Default image path --> {{ $imgPath := .Page.Param "imgPath" }} @@ -26,31 +29,91 @@ {{ $file = path.Join $imgPath $file }} {{ end }} -{{ with $.Page.Resources.GetMatch $file }} +{{ $inputFile := .Page.Resources.GetMatch $file }} + - {{ $mediumRes := (index $imageProc.mediumRes 0) }} +{{ with partial "utilities/image-processing" (dict "context" . "input" $inputFile "resize" $resize "config" $imgProcConfig) }} - {{ $outputSet := slice }} - {{ $inputFile := . }} + {{ if .sets.default }} - {{ range $imageProc }} - {{ $outputSet = $outputSet | append (printf "%s %s" (($inputFile.Resize (index . 0)).RelPermalink) (index . 1)) }} - {{ end }} + <figure> + <picture> + + <!-- Extra sets --> + {{ range .sets.extra }} + <source + srcset='{{ delimit .source ", " }}' + type="{{ .mediaType }}" + > + {{ end }} + + <!-- Default set --> + <source + srcset='{{ delimit .sets.default ", " }}' + type="{{ .default.MediaType }}" + > + + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + {{ with .default }} + src="{{ .RelPermalink }}" + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + > + + </picture> + + {{ with $caption }} + <figcaption>{{ . }}</figcaption> + {{ end }} + </figure> + + {{ else }} - <figure> - <img - {{ with $class }}class="{{ . }}"{{ end }} - loading="lazy" - srcset='{{ delimit $outputSet ", " }}' - src="{{ (.Resize $mediumRes).RelPermalink }}" - width="{{ (.Resize $mediumRes).Width }}" - height="{{ (.Resize $mediumRes).Height }}" - {{ with $alt }}alt="{{ . }}"{{ end }} - /> - - {{ with $caption }} - <figcaption>{{ . }}</figcaption> - {{ end }} + <!-- Avoid trying to get width and height from SVG files --> + {{ if .input }} - </figure> + <figure> + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + {{ with .input }} + src="{{ .RelPermalink }}" + {{ if ne .MediaType.SubType "svg" }} + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + > + {{ with $caption }} + <figcaption>{{ . }}</figcaption> + {{ end }} + </figure> + + {{ else }} + + <!-- If local file isn't found, assume it's a remote file --> + {{ with ($destination | safeURL) }} + + <figure> + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + src="{{ . }}" + {{ with $altText }}alt="{{ . }}"{{ end }} + > + + {{ with $caption }} + <figcaption>{{ . }}</figcaption> + {{ end }} + </figure> + {{ end }} + {{ end }} + + {{ end }} + {{ end }} diff --git a/layouts/shortcodes/gifoid.html b/layouts/shortcodes/gifoid.html index 7ff67a0..2f54076 100644 --- a/layouts/shortcodes/gifoid.html +++ b/layouts/shortcodes/gifoid.html @@ -34,12 +34,39 @@ {{ $videoPath := .Page.Params.videoPath | default "video" }} {{ $filePath := path.Join $videoPath $fileName }} +{{ $pageDir := $.Page.File.Dir }} + +<!-- Make sure video thumbnails are ignored --> {{ $videoFormats := slice "mp4" "webm" }} -<video class="gifoid {{ $class }}" autoplay loop muted playsinline {{ with $title }}title="{{ . }}"{{ end }}> - {{ range $videoFormats }} - <source src="{{ ($.Page.Resources.GetMatch (printf "%s.%s" $filePath .)).RelPermalink }}" type="{{ printf "video/%s" .}}"> +{{ $filesData := slice }} + + +{{ range $videoFormats }} + + {{ $resourcePath := ($.Page.Resources.GetMatch (printf "%s.%s" $filePath .)) }} + + {{ $contentPath := path.Join $pageDir $resourcePath }} + + {{ $file := os.Stat $contentPath }} + + {{ $filesData = $filesData | append (dict "mediaType" $resourcePath.MediaType "size" $file.Size "source" $resourcePath.RelPermalink) }} + +{{ end }} + + +<video + class="gifoid {{ $class }}" + autoplay + loop + muted + playsinline + {{ with $title }}title="{{ . }}"{{ end }} + > + + {{ range sort $filesData "size" }} + <source src="{{ .source }}" type="{{ .mediaType }}"> {{ end }} <p class="error">{{ T "missingCodec" }}</p> diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 5b53676..3d63aee 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -2,20 +2,25 @@ Usage: img "weird_cat.jpg" "Something that can (or not) be a cat." img src="weird_cat.jpg" alt="Something that can (or not) be a cat." - img class="border" src="weird_cat.jpg" alt="Something that can (or not) be a cat." - img "weird_cat.jpg" "Something that can (or not) be a cat." "border" + img class="border" src="weird_cat.jpg" alt="Something that can (or not) be a cat." resize=false + img "weird_cat.jpg" "Something that can (or not) be a cat." "border" false Default available classes: border borderless --> -{{ $file := .Get "src" | default (.Get 0) }} -{{ $altText := .Get "alt" | default (.Get 1) }} -{{ $class := .Get "class" | default (.Get 2) }} +{{ $file := .Get "src" | default (.Get 0) }} +{{ $altText := .Get "alt" | default (.Get 1) }} +{{ $class := .Get "class" | default (.Get 2) }} +{{ $resize := .Get "resize" | default (.Get 3) }} + +{{ $destination := $file }} + + +<!-- Image processing configuration --> +{{ $imgProcConfig := partialCached "utilities/image-processing-config" . }} -<!-- Image processing options --> -{{ $imageProc := (dict "highRes" (.Site.Params.imageProc.highRes | default .Site.Data.default.imageProc.highRes) "mediumRes" (.Site.Params.imageProc.mediumRes | default .Site.Data.default.imageProc.mediumRes) "lowRes" (.Site.Params.imageProc.lowRes | default .Site.Data.default.imageProc.lowRes)) }} <!-- Default image path --> {{ $imgPath := .Page.Param "imgPath" }} @@ -24,25 +29,71 @@ {{ $file = path.Join $imgPath $file }} {{ end }} -{{ with $.Page.Resources.GetMatch $file }} - - {{ $mediumRes := (index $imageProc.mediumRes 0) }} - - {{ $outputSet := slice }} - {{ $inputFile := . }} +{{ $inputFile := .Page.Resources.GetMatch $file }} + + +{{ with partial "utilities/image-processing" (dict "context" . "input" $inputFile "resize" $resize "config" $imgProcConfig) }} + + {{ if .sets.default }} - {{ range $imageProc }} - {{ $outputSet = $outputSet | append (printf "%s %s" (($inputFile.Resize (index . 0)).RelPermalink) (index . 1)) }} - {{ end }} + <picture> + + <!-- Extra sets --> + {{ range .sets.extra }} + <source + srcset='{{ delimit .source ", " }}' + type="{{ .mediaType }}" + > + {{ end }} + + <!-- Default set --> + <source + srcset='{{ delimit .sets.default ", " }}' + type="{{ .default.MediaType }}" + > + + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + {{ with .default }} + src="{{ .RelPermalink }}" + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + > + + </picture> - <img - {{ with $class }}class="{{ . }}"{{ end }} - loading="lazy" - srcset='{{ delimit $outputSet ", " }}' - src="{{ (.Resize $mediumRes).RelPermalink }}" - width="{{ (.Resize $mediumRes).Width }}" - height="{{ (.Resize $mediumRes).Height }}" - {{ with $altText }}alt="{{ . }}"{{ end }} - /> + {{ else }} + <!-- Avoid trying to get width and height from SVG files --> + {{ if .input }} + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + {{ with .input }} + src="{{ .RelPermalink }}" + {{ if ne .MediaType.SubType "svg" }} + width="{{ .Width }}" + height="{{ .Height }}" + {{ end }} + {{ end }} + {{ with $altText }}alt="{{ . }}"{{ end }} + > + {{ else }} + + <!-- If local file isn't found, assume it's a remote file --> + {{ with ($destination | safeURL) }} + <img + {{ with $class }}class="{{ . }}"{{ end }} + loading="lazy" + src="{{ . }}" + {{ with $altText }}alt="{{ . }}"{{ end }} + > + {{ end }} + {{ end }} + + {{ end }} + {{ end }} diff --git a/layouts/shortcodes/social.html b/layouts/shortcodes/social.html index 1fbca63..5f16551 100644 --- a/layouts/shortcodes/social.html +++ b/layouts/shortcodes/social.html @@ -1,14 +1,14 @@ {{ if .Site.Params.Social }} <!-- Get SVG bundle --> - {{ $svgBundleLink := (.Page.Scratch.Get "svgBundle").RelPermalink }} + {{ $svgBundleLink := (partialCached "svg-bundle" .) }} <!-- Reduce repetition... --> {{ $centralized := $.Site.Params.Social.Centralized }} {{ $decentralized := $.Site.Params.Social.Decentralized }} - <section class="social"> + <div class="social"> {{ range .Site.Data.social }} @@ -58,5 +58,5 @@ {{ end }} - </section> + </div> {{ end }}
\ No newline at end of file diff --git a/static/libs/fuse.js@6.5.3/dist/fuse.basic.esm.min.js b/static/libs/fuse.js@6.5.3/dist/fuse.basic.esm.min.js deleted file mode 100644 index 2992efb..0000000 --- a/static/libs/fuse.js@6.5.3/dist/fuse.basic.esm.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Fuse.js v6.5.3 - Lightweight fuzzy-search (http://fusejs.io) - * - * Copyright (c) 2021 Kiro Risk (http://kiro.me) - * All Rights Reserved. Apache Software License 2.0 - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ -function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===o(e)}function t(e){return"string"==typeof e}function n(e){return"number"==typeof e}function i(e){return!0===e||!1===e||function(e){return function(e){return"object"==typeof e}(e)&&null!==e}(e)&&"[object Boolean]"==o(e)}function s(e){return null!=e}function r(e){return!e.trim().length}function o(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const c=Object.prototype.hasOwnProperty;class h{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let n=a(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function a(n){let i=null,s=null,r=null,o=1;if(t(n)||e(n))r=n,i=l(n),s=d(n);else{if(!c.call(n,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const e=n.name;if(r=e,c.call(n,"weight")&&(o=n.weight,o<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(e));i=l(e),s=d(e)}return{path:i,id:s,weight:o,src:r}}function l(t){return e(t)?t:t.split(".")}function d(t){return e(t)?t.join("."):t}var u={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(r,o){let c=[],h=!1;const a=(r,o,l)=>{if(s(r))if(o[l]){const d=r[o[l]];if(!s(d))return;if(l===o.length-1&&(t(d)||n(d)||i(d)))c.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(e(d)){h=!0;for(let e=0,t=d.length;e<t;e+=1)a(d[e],o,l+1)}else o.length&&a(d,o,l+1)}else c.push(r)};return a(r,t(o)?o.split("."):o,0),h?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const f=/[^ ]+/g;class g{constructor({getFn:e=u.getFn,fieldNormWeight:t=u.fieldNormWeight}={}){this.norm=function(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(t){const s=t.match(f).length;if(n.has(s))return n.get(s);const r=1/Math.pow(s,.5*e),o=parseFloat(Math.round(r*i)/i);return n.set(s,o),o},clear(){n.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,t(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const n=this.size();t(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!s(e)||r(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(n,i){let o={i:i,$:{}};this.keys.forEach(((i,c)=>{let h=this.getFn(n,i.path);if(s(h))if(e(h)){let n=[];const i=[{nestedArrIndex:-1,value:h}];for(;i.length;){const{nestedArrIndex:o,value:c}=i.pop();if(s(c))if(t(c)&&!r(c)){let e={v:c,i:o,n:this.norm.get(c)};n.push(e)}else e(c)&&c.forEach(((e,t)=>{i.push({nestedArrIndex:t,value:e})}))}o.$[c]=n}else if(!r(h)){let e={v:h,n:this.norm.get(h)};o.$[c]=e}})),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function p(e,t,{getFn:n=u.getFn,fieldNormWeight:i=u.fieldNormWeight}={}){const s=new g({getFn:n,fieldNormWeight:i});return s.setKeys(e.map(a)),s.setSources(t),s.create(),s}function m(e,{errors:t=0,currentLocation:n=0,expectedLocation:i=0,distance:s=u.distance,ignoreLocation:r=u.ignoreLocation}={}){const o=t/e.length;if(r)return o;const c=Math.abs(i-n);return s?o+c/s:c?1:o}function y(e,t,n,{location:i=u.location,distance:s=u.distance,threshold:r=u.threshold,findAllMatches:o=u.findAllMatches,minMatchCharLength:c=u.minMatchCharLength,includeMatches:h=u.includeMatches,ignoreLocation:a=u.ignoreLocation}={}){if(t.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const l=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let g=r,p=f;const y=c>1||h,M=y?Array(d):[];let x;for(;(x=e.indexOf(t,p))>-1;){let e=m(t,{currentLocation:x,expectedLocation:f,distance:s,ignoreLocation:a});if(g=Math.min(e,g),p=x+l,y){let e=0;for(;e<l;)M[x+e]=1,e+=1}}p=-1;let L=[],_=1,k=l+d;const v=1<<l-1;for(let i=0;i<l;i+=1){let r=0,c=k;for(;r<c;){m(t,{errors:i,currentLocation:f+c,expectedLocation:f,distance:s,ignoreLocation:a})<=g?r=c:k=c,c=Math.floor((k-r)/2+r)}k=c;let h=Math.max(1,f-c+1),u=o?d:Math.min(f+c,d)+l,x=Array(u+2);x[u+1]=(1<<i)-1;for(let r=u;r>=h;r-=1){let o=r-1,c=n[e.charAt(o)];if(y&&(M[o]=+!!c),x[r]=(x[r+1]<<1|1)&c,i&&(x[r]|=(L[r+1]|L[r])<<1|1|L[r+1]),x[r]&v&&(_=m(t,{errors:i,currentLocation:o,expectedLocation:f,distance:s,ignoreLocation:a}),_<=g)){if(g=_,p=o,p<=f)break;h=Math.max(1,2*f-p)}}if(m(t,{errors:i+1,currentLocation:f,expectedLocation:f,distance:s,ignoreLocation:a})>g)break;L=x}const w={isMatch:p>=0,score:Math.max(.001,_)};if(y){const e=function(e=[],t=u.minMatchCharLength){let n=[],i=-1,s=-1,r=0;for(let o=e.length;r<o;r+=1){let o=e[r];o&&-1===i?i=r:o||-1===i||(s=r-1,s-i+1>=t&&n.push([i,s]),i=-1)}return e[r-1]&&r-i>=t&&n.push([i,r-1]),n}(M,c);e.length?h&&(w.indices=e):w.isMatch=!1}return w}function M(e){let t={};for(let n=0,i=e.length;n<i;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<i-n-1}return t}class x{constructor(e,{location:t=u.location,threshold:n=u.threshold,distance:i=u.distance,includeMatches:s=u.includeMatches,findAllMatches:r=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,isCaseSensitive:c=u.isCaseSensitive,ignoreLocation:h=u.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:c,ignoreLocation:h},this.pattern=c?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const a=(e,t)=>{this.chunks.push({pattern:e,alphabet:M(e),startIndex:t})},l=this.pattern.length;if(l>32){let e=0;const t=l%32,n=l-t;for(;e<n;)a(this.pattern.substr(e,32),e),e+=32;if(t){const e=l-32;a(this.pattern.substr(e),e)}}else a(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}const{location:i,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:c,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach((({pattern:t,alphabet:u,startIndex:f})=>{const{isMatch:g,score:p,indices:m}=y(e,t,u,{location:i+f,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:c,includeMatches:n,ignoreLocation:h});g&&(d=!0),l+=p,g&&m&&(a=[...a,...m])}));let u={isMatch:d,score:d?l/this.chunks.length:1};return d&&n&&(u.indices=a),u}}const L=[];function _(e,t){for(let n=0,i=L.length;n<i;n+=1){let i=L[n];if(i.condition(e,t))return new i(e,t)}return new x(e,t)}function k(e,t){const n=e.matches;t.matches=[],s(n)&&n.forEach((e=>{if(!s(e.indices)||!e.indices.length)return;const{indices:n,value:i}=e;let r={indices:n,value:i};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function v(e,t){t.score=e.score}class w{constructor(e,t={},n){if(this.options={...u,...t},this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new h(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw new Error("Incorrect 'index' type");this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){s(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let n=0,i=this._docs.length;n<i;n+=1){const s=this._docs[n];e(s,n)&&(this.removeAt(n),n-=1,i-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:i=-1}={}){const{includeMatches:s,includeScore:r,shouldSort:o,sortFn:c,ignoreFieldNorm:h}=this.options;let a=t(e)?t(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=u.ignoreFieldNorm}){e.forEach((e=>{let n=1;e.matches.forEach((({key:e,norm:i,score:s})=>{const r=e?e.weight:null;n*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(t?1:i))})),e.score=n}))}(a,{ignoreFieldNorm:h}),o&&a.sort(c),n(i)&&i>-1&&(a=a.slice(0,i)),function(e,t,{includeMatches:n=u.includeMatches,includeScore:i=u.includeScore}={}){const s=[];return n&&s.push(k),i&&s.push(v),e.map((e=>{const{idx:n}=e,i={item:t[n],refIndex:n};return s.length&&s.forEach((t=>{t(e,i)})),i}))}(a,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(e){const t=_(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach((({v:e,i:n,n:r})=>{if(!s(e))return;const{isMatch:o,score:c,indices:h}=t.searchIn(e);o&&i.push({item:e,idx:n,matches:[{score:c,value:e,norm:r,indices:h}]})})),i}_searchLogical(e){throw new Error("Logical search is not available")}_searchObjectList(e){const t=_(e,this.options),{keys:n,records:i}=this._myIndex,r=[];return i.forEach((({$:e,i:i})=>{if(!s(e))return;let o=[];n.forEach(((n,i)=>{o.push(...this._findMatches({key:n,value:e[i],searcher:t}))})),o.length&&r.push({idx:i,item:e,matches:o})})),r}_findMatches({key:t,value:n,searcher:i}){if(!s(n))return[];let r=[];if(e(n))n.forEach((({v:e,i:n,n:o})=>{if(!s(e))return;const{isMatch:c,score:h,indices:a}=i.searchIn(e);c&&r.push({score:h,key:t,value:e,idx:n,norm:o,indices:a})}));else{const{v:e,n:s}=n,{isMatch:o,score:c,indices:h}=i.searchIn(e);o&&r.push({score:c,key:t,value:e,norm:s,indices:h})}return r}}w.version="6.5.3",w.createIndex=p,w.parseIndex=function(e,{getFn:t=u.getFn,fieldNormWeight:n=u.fieldNormWeight}={}){const{keys:i,records:s}=e,r=new g({getFn:t,fieldNormWeight:n});return r.setKeys(i),r.setIndexRecords(s),r},w.config=u;export{w as default};
\ No newline at end of file diff --git a/static/libs/fuse.js@6.6.2/dist/fuse.basic.esm.min.js b/static/libs/fuse.js@6.6.2/dist/fuse.basic.esm.min.js new file mode 100644 index 0000000..2a2220c --- /dev/null +++ b/static/libs/fuse.js@6.6.2/dist/fuse.basic.esm.min.js @@ -0,0 +1,9 @@ +/** + * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) + * + * Copyright (c) 2022 Kiro Risk (http://kiro.me) + * All Rights Reserved. Apache Software License 2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===o(e)}function t(e){return"string"==typeof e}function n(e){return"number"==typeof e}function i(e){return!0===e||!1===e||function(e){return function(e){return"object"==typeof e}(e)&&null!==e}(e)&&"[object Boolean]"==o(e)}function s(e){return null!=e}function r(e){return!e.trim().length}function o(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const c=Object.prototype.hasOwnProperty;class h{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let n=a(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function a(n){let i=null,s=null,r=null,o=1,h=null;if(t(n)||e(n))r=n,i=l(n),s=d(n);else{if(!c.call(n,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const e=n.name;if(r=e,c.call(n,"weight")&&(o=n.weight,o<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(e));i=l(e),s=d(e),h=n.getFn}return{path:i,id:s,weight:o,src:r,getFn:h}}function l(t){return e(t)?t:t.split(".")}function d(t){return e(t)?t.join("."):t}var u={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(r,o){let c=[],h=!1;const a=(r,o,l)=>{if(s(r))if(o[l]){const d=r[o[l]];if(!s(d))return;if(l===o.length-1&&(t(d)||n(d)||i(d)))c.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(e(d)){h=!0;for(let e=0,t=d.length;e<t;e+=1)a(d[e],o,l+1)}else o.length&&a(d,o,l+1)}else c.push(r)};return a(r,t(o)?o.split("."):o,0),h?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const f=/[^ ]+/g;class g{constructor({getFn:e=u.getFn,fieldNormWeight:t=u.fieldNormWeight}={}){this.norm=function(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(t){const s=t.match(f).length;if(n.has(s))return n.get(s);const r=1/Math.pow(s,.5*e),o=parseFloat(Math.round(r*i)/i);return n.set(s,o),o},clear(){n.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,t(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const n=this.size();t(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!s(e)||r(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(n,i){let o={i:i,$:{}};this.keys.forEach(((i,c)=>{let h=i.getFn?i.getFn(n):this.getFn(n,i.path);if(s(h))if(e(h)){let n=[];const i=[{nestedArrIndex:-1,value:h}];for(;i.length;){const{nestedArrIndex:o,value:c}=i.pop();if(s(c))if(t(c)&&!r(c)){let e={v:c,i:o,n:this.norm.get(c)};n.push(e)}else e(c)&&c.forEach(((e,t)=>{i.push({nestedArrIndex:t,value:e})}))}o.$[c]=n}else if(t(h)&&!r(h)){let e={v:h,n:this.norm.get(h)};o.$[c]=e}})),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function p(e,t,{getFn:n=u.getFn,fieldNormWeight:i=u.fieldNormWeight}={}){const s=new g({getFn:n,fieldNormWeight:i});return s.setKeys(e.map(a)),s.setSources(t),s.create(),s}function m(e,{errors:t=0,currentLocation:n=0,expectedLocation:i=0,distance:s=u.distance,ignoreLocation:r=u.ignoreLocation}={}){const o=t/e.length;if(r)return o;const c=Math.abs(i-n);return s?o+c/s:c?1:o}function y(e,t,n,{location:i=u.location,distance:s=u.distance,threshold:r=u.threshold,findAllMatches:o=u.findAllMatches,minMatchCharLength:c=u.minMatchCharLength,includeMatches:h=u.includeMatches,ignoreLocation:a=u.ignoreLocation}={}){if(t.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const l=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let g=r,p=f;const y=c>1||h,M=y?Array(d):[];let x;for(;(x=e.indexOf(t,p))>-1;){let e=m(t,{currentLocation:x,expectedLocation:f,distance:s,ignoreLocation:a});if(g=Math.min(e,g),p=x+l,y){let e=0;for(;e<l;)M[x+e]=1,e+=1}}p=-1;let L=[],_=1,k=l+d;const v=1<<l-1;for(let i=0;i<l;i+=1){let r=0,c=k;for(;r<c;){m(t,{errors:i,currentLocation:f+c,expectedLocation:f,distance:s,ignoreLocation:a})<=g?r=c:k=c,c=Math.floor((k-r)/2+r)}k=c;let h=Math.max(1,f-c+1),u=o?d:Math.min(f+c,d)+l,x=Array(u+2);x[u+1]=(1<<i)-1;for(let r=u;r>=h;r-=1){let o=r-1,c=n[e.charAt(o)];if(y&&(M[o]=+!!c),x[r]=(x[r+1]<<1|1)&c,i&&(x[r]|=(L[r+1]|L[r])<<1|1|L[r+1]),x[r]&v&&(_=m(t,{errors:i,currentLocation:o,expectedLocation:f,distance:s,ignoreLocation:a}),_<=g)){if(g=_,p=o,p<=f)break;h=Math.max(1,2*f-p)}}if(m(t,{errors:i+1,currentLocation:f,expectedLocation:f,distance:s,ignoreLocation:a})>g)break;L=x}const w={isMatch:p>=0,score:Math.max(.001,_)};if(y){const e=function(e=[],t=u.minMatchCharLength){let n=[],i=-1,s=-1,r=0;for(let o=e.length;r<o;r+=1){let o=e[r];o&&-1===i?i=r:o||-1===i||(s=r-1,s-i+1>=t&&n.push([i,s]),i=-1)}return e[r-1]&&r-i>=t&&n.push([i,r-1]),n}(M,c);e.length?h&&(w.indices=e):w.isMatch=!1}return w}function M(e){let t={};for(let n=0,i=e.length;n<i;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<i-n-1}return t}class x{constructor(e,{location:t=u.location,threshold:n=u.threshold,distance:i=u.distance,includeMatches:s=u.includeMatches,findAllMatches:r=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,isCaseSensitive:c=u.isCaseSensitive,ignoreLocation:h=u.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:c,ignoreLocation:h},this.pattern=c?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const a=(e,t)=>{this.chunks.push({pattern:e,alphabet:M(e),startIndex:t})},l=this.pattern.length;if(l>32){let e=0;const t=l%32,n=l-t;for(;e<n;)a(this.pattern.substr(e,32),e),e+=32;if(t){const e=l-32;a(this.pattern.substr(e),e)}}else a(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}const{location:i,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:c,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach((({pattern:t,alphabet:u,startIndex:f})=>{const{isMatch:g,score:p,indices:m}=y(e,t,u,{location:i+f,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:c,includeMatches:n,ignoreLocation:h});g&&(d=!0),l+=p,g&&m&&(a=[...a,...m])}));let u={isMatch:d,score:d?l/this.chunks.length:1};return d&&n&&(u.indices=a),u}}const L=[];function _(e,t){for(let n=0,i=L.length;n<i;n+=1){let i=L[n];if(i.condition(e,t))return new i(e,t)}return new x(e,t)}function k(e,t){const n=e.matches;t.matches=[],s(n)&&n.forEach((e=>{if(!s(e.indices)||!e.indices.length)return;const{indices:n,value:i}=e;let r={indices:n,value:i};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function v(e,t){t.score=e.score}class w{constructor(e,t={},n){if(this.options={...u,...t},this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new h(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw new Error("Incorrect 'index' type");this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){s(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let n=0,i=this._docs.length;n<i;n+=1){const s=this._docs[n];e(s,n)&&(this.removeAt(n),n-=1,i-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:i=-1}={}){const{includeMatches:s,includeScore:r,shouldSort:o,sortFn:c,ignoreFieldNorm:h}=this.options;let a=t(e)?t(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=u.ignoreFieldNorm}){e.forEach((e=>{let n=1;e.matches.forEach((({key:e,norm:i,score:s})=>{const r=e?e.weight:null;n*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(t?1:i))})),e.score=n}))}(a,{ignoreFieldNorm:h}),o&&a.sort(c),n(i)&&i>-1&&(a=a.slice(0,i)),function(e,t,{includeMatches:n=u.includeMatches,includeScore:i=u.includeScore}={}){const s=[];return n&&s.push(k),i&&s.push(v),e.map((e=>{const{idx:n}=e,i={item:t[n],refIndex:n};return s.length&&s.forEach((t=>{t(e,i)})),i}))}(a,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(e){const t=_(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach((({v:e,i:n,n:r})=>{if(!s(e))return;const{isMatch:o,score:c,indices:h}=t.searchIn(e);o&&i.push({item:e,idx:n,matches:[{score:c,value:e,norm:r,indices:h}]})})),i}_searchLogical(e){throw new Error("Logical search is not available")}_searchObjectList(e){const t=_(e,this.options),{keys:n,records:i}=this._myIndex,r=[];return i.forEach((({$:e,i:i})=>{if(!s(e))return;let o=[];n.forEach(((n,i)=>{o.push(...this._findMatches({key:n,value:e[i],searcher:t}))})),o.length&&r.push({idx:i,item:e,matches:o})})),r}_findMatches({key:t,value:n,searcher:i}){if(!s(n))return[];let r=[];if(e(n))n.forEach((({v:e,i:n,n:o})=>{if(!s(e))return;const{isMatch:c,score:h,indices:a}=i.searchIn(e);c&&r.push({score:h,key:t,value:e,idx:n,norm:o,indices:a})}));else{const{v:e,n:s}=n,{isMatch:o,score:c,indices:h}=i.searchIn(e);o&&r.push({score:c,key:t,value:e,norm:s,indices:h})}return r}}w.version="6.6.2",w.createIndex=p,w.parseIndex=function(e,{getFn:t=u.getFn,fieldNormWeight:n=u.fieldNormWeight}={}){const{keys:i,records:s}=e,r=new g({getFn:t,fieldNormWeight:n});return r.setKeys(i),r.setIndexRecords(s),r},w.config=u;export{w as default};
\ No newline at end of file diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.ttf Binary files differindex c6f9a5e..c6f9a5e 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.woff Binary files differindex b804d7b..b804d7b 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.woff2 Binary files differindex 0acaaff..0acaaff 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_AMS-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_AMS-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.ttf Binary files differindex 9ff4a5e..9ff4a5e 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.woff Binary files differindex 9759710..9759710 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.woff2 Binary files differindex f390922..f390922 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Bold.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.ttf Binary files differindex f522294..f522294 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.woff Binary files differindex 9bdd534..9bdd534 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.woff2 Binary files differindex 75344a1..75344a1 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Caligraphic-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.ttf Binary files differindex 4e98259..4e98259 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.woff Binary files differindex e7730f6..e7730f6 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.woff2 Binary files differindex 395f28b..395f28b 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Bold.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Bold.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.ttf Binary files differindex b8461b2..b8461b2 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.woff Binary files differindex acab069..acab069 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.woff2 Binary files differindex 735f694..735f694 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Fraktur-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Fraktur-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.ttf Binary files differindex 4060e62..4060e62 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.woff Binary files differindex f38136a..f38136a 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.woff2 Binary files differindex ab2ad21..ab2ad21 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Bold.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Bold.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.ttf Binary files differindex dc00797..dc00797 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.woff Binary files differindex 67807b0..67807b0 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.woff2 Binary files differindex 5931794..5931794 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-BoldItalic.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-BoldItalic.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.ttf Binary files differindex 0e9b0f3..0e9b0f3 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.woff Binary files differindex 6f43b59..6f43b59 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.woff2 Binary files differindex b50920e..b50920e 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Italic.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Italic.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.ttf Binary files differindex dd45e1e..dd45e1e 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.woff Binary files differindex 21f5812..21f5812 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.woff2 Binary files differindex eb24a7b..eb24a7b 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Main-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Main-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.ttf Binary files differindex 728ce7a..728ce7a 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.woff Binary files differindex 0ae390d..0ae390d 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.woff2 Binary files differindex 2965702..2965702 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-BoldItalic.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-BoldItalic.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.ttf Binary files differindex 70d559b..70d559b 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.woff Binary files differindex eb5159d..eb5159d 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.woff2 Binary files differindex 215c143..215c143 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Math-Italic.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Math-Italic.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.ttf Binary files differindex 2f65a8a..2f65a8a 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.woff Binary files differindex 8d47c02..8d47c02 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.woff2 Binary files differindex cfaa3bd..cfaa3bd 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Bold.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Bold.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.ttf Binary files differindex d5850df..d5850df 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.woff Binary files differindex 7e02df9..7e02df9 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.woff2 Binary files differindex 349c06d..349c06d 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Italic.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Italic.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.ttf Binary files differindex 537279f..537279f 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.woff Binary files differindex 31b8482..31b8482 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.woff2 Binary files differindex a90eea8..a90eea8 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_SansSerif-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_SansSerif-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.ttf Binary files differindex fd679bf..fd679bf 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.woff Binary files differindex 0e7da82..0e7da82 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.woff2 Binary files differindex b3048fc..b3048fc 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Script-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Script-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.ttf Binary files differindex 871fd7d..871fd7d 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.woff Binary files differindex 7f292d9..7f292d9 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.woff2 Binary files differindex c5a8462..c5a8462 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size1-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size1-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.ttf Binary files differindex 7a212ca..7a212ca 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.woff Binary files differindex d241d9b..d241d9b 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.woff2 Binary files differindex e1bccfe..e1bccfe 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size2-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size2-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.ttf Binary files differindex 00bff34..00bff34 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.woff Binary files differindex e6e9b65..e6e9b65 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.woff2 Binary files differindex 249a286..249a286 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size3-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size3-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.ttf Binary files differindex 74f0892..74f0892 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.woff Binary files differindex e1ec545..e1ec545 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.woff2 Binary files differindex 680c130..680c130 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Size4-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Size4-Regular.woff2 diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.ttf b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.ttf Binary files differindex c83252c..c83252c 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.ttf +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.ttf diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.woff b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.woff Binary files differindex 2432419..2432419 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.woff +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.woff diff --git a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.woff2 b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.woff2 Binary files differindex 771f1af..771f1af 100644 --- a/static/libs/katex@0.15.3/dist/fonts/KaTeX_Typewriter-Regular.woff2 +++ b/static/libs/katex@0.15.6/dist/fonts/KaTeX_Typewriter-Regular.woff2 |