aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/actions.yml2
-rw-r--r--README.md6
-rw-r--r--content/overview-abridge/1.css0
-rw-r--r--content/overview-abridge/index.es.md10
-rw-r--r--content/overview-abridge/index.fr.md10
-rw-r--r--content/overview-abridge/index.md10
-rw-r--r--content/overview-images/index.es.md48
-rw-r--r--content/overview-images/index.fr.md48
-rw-r--r--content/overview-images/index.md48
-rw-r--r--content/overview-math.es.md32
-rw-r--r--content/overview-math.fr.md32
-rw-r--r--content/overview-math.md32
-rw-r--r--content/overview-rich-content/index.es.md48
-rw-r--r--content/overview-rich-content/index.fr.md48
-rw-r--r--content/overview-rich-content/index.md48
-rw-r--r--content/overview-showdata.es.md2
-rw-r--r--content/overview-showdata.fr.md2
-rw-r--r--content/overview-showdata.md2
-rw-r--r--content/pages/about.es.md2
-rw-r--r--content/pages/about.fr.md2
-rw-r--r--content/pages/about.md2
-rw-r--r--content/pages/about.pt.md2
-rw-r--r--content/video-streaming-sites/overview-embed-streamable.es.md8
-rw-r--r--content/video-streaming-sites/overview-embed-streamable.fr.md8
-rw-r--r--content/video-streaming-sites/overview-embed-streamable.md8
-rw-r--r--content/video-streaming-sites/overview-embed-vimeo.es.md8
-rw-r--r--content/video-streaming-sites/overview-embed-vimeo.fr.md8
-rw-r--r--content/video-streaming-sites/overview-embed-vimeo.md8
-rw-r--r--content/video-streaming-sites/overview-embed-youtube.es.md8
-rw-r--r--content/video-streaming-sites/overview-embed-youtube.fr.md8
-rw-r--r--content/video-streaming-sites/overview-embed-youtube.md8
-rw-r--r--netlify.toml2
-rw-r--r--package_abridge.js77
-rw-r--r--sass/abridge.scss134
-rw-r--r--static/js/abridge.min.js2
-rw-r--r--static/js/abridge_nopwa.min.js2
-rw-r--r--static/js/abridge_nosearch.min.js2
-rw-r--r--static/js/abridge_nosearch_nopwa.min.js2
-rw-r--r--static/js/codecopy.js23
-rw-r--r--static/js/search_tinysearch.min.js2
-rw-r--r--static/js/tinysearch.js350
-rw-r--r--static/sw.js382
-rw-r--r--static/sw.min.js2
-rw-r--r--static/tinysearch.toml4
-rwxr-xr-xstatic/tinysearch_engine.wasmbin0 -> 94942 bytes
-rw-r--r--static/tinysearch_engine_bg.wasmbin97522 -> 0 bytes
-rw-r--r--templates/404.html27
-rw-r--r--templates/archive.html29
-rw-r--r--templates/base.html60
-rw-r--r--templates/categories/list.html33
-rw-r--r--templates/categories/single.html31
-rw-r--r--templates/components/audio.html30
-rw-r--r--templates/components/components.html (renamed from templates/macros/macros.html)440
-rw-r--r--templates/components/gif.html30
-rw-r--r--templates/components/image.html (renamed from templates/shortcodes/image.html)35
-rw-r--r--templates/components/img.html (renamed from templates/shortcodes/img.html)31
-rw-r--r--templates/components/imgswap.html (renamed from templates/shortcodes/imgswap.html)57
-rw-r--r--templates/components/katex.html3
-rw-r--r--templates/components/showdata.html9
-rw-r--r--templates/components/streamable.html (renamed from templates/shortcodes/streamable.html)2
-rw-r--r--templates/components/video.html30
-rw-r--r--templates/components/vimeo.html (renamed from templates/shortcodes/vimeo.html)2
-rw-r--r--templates/components/youtube.html (renamed from templates/shortcodes/youtube.html)2
-rw-r--r--templates/index.html74
-rw-r--r--templates/macros/seo.html145
-rw-r--r--templates/page.html194
-rw-r--r--templates/pages.html53
-rw-r--r--templates/partials/head.html44
-rw-r--r--templates/partials/head_js.html52
-rw-r--r--templates/partials/social.html4
-rw-r--r--templates/shortcodes/audio.html29
-rw-r--r--templates/shortcodes/gif.html29
-rw-r--r--templates/shortcodes/katex.html1
-rw-r--r--templates/shortcodes/showdata.html18
-rw-r--r--templates/shortcodes/video.html29
-rw-r--r--templates/tags/list.html33
-rw-r--r--templates/tags/single.html31
-rw-r--r--theme.toml2
-rw-r--r--zola.toml (renamed from config.toml)4
79 files changed, 1557 insertions, 1528 deletions
diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml
index c554863..b6851da 100644
--- a/.github/workflows/actions.yml
+++ b/.github/workflows/actions.yml
@@ -6,6 +6,8 @@ on:
pull_request:
branches:
- master
+permissions:
+ contents: write
jobs:
generate-sponsors:
runs-on: ubuntu-latest
diff --git a/README.md b/README.md
index 7cb8584..d365f15 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
# Abridge Zola Theme
-A fast, lightweight, and modern [Zola](https://getzola.org) theme utilizing [abridge.css](https://github.com/Jieiku/abridge.css) (a class-light semantic HTML CSS Framework). Perfect [Lighthouse](https://pagespeed.web.dev/report?url=abridge.pages.dev), [YellowLabTools](https://yellowlab.tools/), and [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app) scores. Here is a [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md) Page.
+A fast, lightweight, and modern [Zola](https://getzola.org) theme utilizing class-light semantic HTML with modular CSS. Perfect [Lighthouse](https://pagespeed.web.dev/report?url=abridge.pages.dev), [YellowLabTools](https://yellowlab.tools/), and [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app) scores. Here is a [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md) Page.
![Lighthouse Score](https://raw.githubusercontent.com/Jieiku/abridge/master/content/overview-abridge/lighthouse.png)
@@ -14,10 +14,6 @@ Maintenance of this project is made possible by all the <a href="https://github.
---
**[View Abridge demo](https://abridge.pages.dev/overview-abridge/)**
-
-**[View Abridge.css demo](https://abridge-css.pages.dev/overview-abridge/)** [[abridge.css framework](https://github.com/Jieiku/abridge.css/tree/master/dist)]
-
-The Abridge.css demo is simply using Abridge theme as a submodule: [config.toml](https://github.com/Jieiku/abridge.css/blob/master/config.toml), [sass/abridge.scss](https://github.com/Jieiku/abridge.css/blob/master/sass/abridge.scss)
</div>
## Features
diff --git a/content/overview-abridge/1.css b/content/overview-abridge/1.css
deleted file mode 100644
index e69de29..0000000
--- a/content/overview-abridge/1.css
+++ /dev/null
diff --git a/content/overview-abridge/index.es.md b/content/overview-abridge/index.es.md
index 5b06119..864cf2e 100644
--- a/content/overview-abridge/index.es.md
+++ b/content/overview-abridge/index.es.md
@@ -15,7 +15,7 @@ tags = [
"Config",
]
+++
-Un tema [Zola](https://getzola.org) rápido, ligero y moderno que utiliza [abridge.css](https://github.com/Jieiku/abridge.css) (un framework CSS HTML semántico de clase ligera). Puntuaciones perfectas de [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/) y [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app). Aquí hay una página de [Benchmarks de Zola Themes](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md).
+Un tema para [Zola](https://getzola.org) rápido, ligero y moderno que utiliza HTML semántico con pocas clases y CSS modular.. Puntuaciones perfectas de [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/) y [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app). Aquí hay una página de [Benchmarks de Zola Themes](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md).
<!-- more -->
@@ -54,7 +54,7 @@ Un tema [Zola](https://getzola.org) rápido, ligero y moderno que utiliza [abrid
## Inicio rápido
-Este tema requiere la versión {{ showdata(src="https://raw.githubusercontent.com/Jieiku/abridge/master/theme.toml" key="min_version" type="toml") }} o posterior de [Zola](https://www.getzola.org/documentation/getting-started/installation/)
+Este tema requiere la versión {{<showdata src="https://raw.githubusercontent.com/Jieiku/abridge/master/theme.toml" key="min_version" type="toml" page={page} config={config} />}} o posterior de [Zola](https://www.getzola.org/documentation/getting-started/installation/)
```bash
git clone https://github.com/jieiku/abridge.git
@@ -138,7 +138,7 @@ Zola iniciará el servidor web dev, accesible por defecto en `http://127.0.0.1:1
Los cambios guardados se recargarán en vivo en el navegador. (pulse `ctrl+f5`, o mientras desarrolla configure `pwa=false` en `config.toml`)
-## Paginación {#pagination}
+## Paginación {% raw %}{#pagination}{% endraw %}
Puede establecer el número de elementos de la página de inicio editando el archivo `content\_index.md` y ajustando `paginate_by`
@@ -241,7 +241,7 @@ menu_footer = [
]
```
-### Etiquetas SEO y de cabecera {#seo}
+### Etiquetas SEO y de cabecera {% raw %}{#seo}{% endraw %}
Puede revisar las etiquetas SEO en la macro seo ubicada en `templates/macros/seo.html`, todos los valores configurables deben estar en `config.toml` bajo `config.extra` o en los archivos markdown de contenido.
@@ -268,7 +268,7 @@ Puedes ver una demo en [esta página](https://abridge.netlify.app/overview-math/
Para un mejor rendimiento, recomiendo sólo habilitar las matemáticas en una [base por página en sus archivos post.md](https://github.com/Jieiku/abridge/blob/master/content/overview-math.md?plain=1#L11-L13), en lugar de en su archivo config.toml principal.
-### PWA, Aplicación Web Progresiva {#pwa}
+### PWA, Aplicación Web Progresiva {% raw %}{#pwa}{% endraw %}
Abridge tema tiene soporte PWA. Puede instalar todo el sitio como una aplicación y hacer que funcione sin conexión. Para probarlo simplemente usa google chrome o tu teléfono y ve aquí: [abridge.netlify.app](https://abridge.netlify.app/)
diff --git a/content/overview-abridge/index.fr.md b/content/overview-abridge/index.fr.md
index eb04aec..787d3ff 100644
--- a/content/overview-abridge/index.fr.md
+++ b/content/overview-abridge/index.fr.md
@@ -15,7 +15,7 @@ tags = [
"Config",
]
+++
-Un thème rapide, léger et moderne [Zola](https://getzola.org) utilisant [abridge.css](https://github.com/Jieiku/abridge.css) (un cadre HTML CSS sémantique de classe légère). Les scores de [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/) et [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app) sont parfaits. Voici une page [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md).
+Un thème [Zola](https://getzola.org) rapide, léger et moderne, utilisant un HTML sémantique épuré (peu de classes) et du CSS modulaire. Les scores de [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/) et [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app) sont parfaits. Voici une page [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md).
<!-- more -->
@@ -54,7 +54,7 @@ Un thème rapide, léger et moderne [Zola](https://getzola.org) utilisant [abrid
## Démarrage rapide
-Ce thème nécessite la version {{ showdata(src="https://raw.githubusercontent.com/Jieiku/abridge/master/theme.toml" key="min_version" type="toml") }} ou ultérieure de [Zola](https://www.getzola.org/documentation/getting-started/installation/)
+Ce thème nécessite la version {{<showdata src="https://raw.githubusercontent.com/Jieiku/abridge/master/theme.toml" key="min_version" type="toml" page={page} config={config} />}} ou ultérieure de [Zola](https://www.getzola.org/documentation/getting-started/installation/)
```bash
git clone https://github.com/jieiku/abridge.git
@@ -138,7 +138,7 @@ Zola va démarrer le serveur web dev, accessible par défaut à `http://127.0.0.
Les changements sauvegardés seront rechargés en direct dans le navigateur. (appuyez sur `ctrl+f5`, ou pendant le développement mettez `pwa=false` dans `config.toml`)
-## Pagination {#pagination}
+## Pagination {% raw %}{#pagination}{% endraw %}
Vous pouvez définir le nombre d'éléments de la page d'accueil en éditant le fichier `content_index.md` et en ajustant `paginate_by`
@@ -241,7 +241,7 @@ menu_footer = [
]
```
-### SEO et balises d'en-tête {#seo}
+### SEO et balises d'en-tête {% raw %}{#seo}{% endraw %}
Vous pouvez revoir les balises SEO dans la macro seo située dans `templates/macros/seo.html`, toutes les valeurs configurables doivent être dans `config.toml` sous `config.extra` ou dans les fichiers markdown du contenu.
@@ -268,7 +268,7 @@ Vous pouvez voir une démo sur [cette page] (https://abridge.netlify.app/overvie
Pour de meilleures performances, je recommande de n'activer les mathématiques que [par base de page dans vos fichiers post.md](https://github.com/Jieiku/abridge/blob/master/content/overview-math.md?plain=1#L11-L13), plutôt que dans votre fichier config.toml principal.
-### PWA, Progressive Web App {#pwa}
+### PWA, Progressive Web App {% raw %}{#pwa}{% endraw %}
Le thème Abridge supporte les PWA. Vous pouvez installer le site entier en tant qu'application et le faire fonctionner hors ligne. Pour l'essayer, il suffit d'utiliser Google Chrome ou votre téléphone et d'aller ici : [abridge.netlify.app](https://abridge.netlify.app/)
diff --git a/content/overview-abridge/index.md b/content/overview-abridge/index.md
index 22044a6..d7f3d01 100644
--- a/content/overview-abridge/index.md
+++ b/content/overview-abridge/index.md
@@ -15,7 +15,7 @@ tags = [
"Config",
]
+++
-A fast, lightweight, and modern [Zola](https://getzola.org) theme utilizing [abridge.css](https://github.com/Jieiku/abridge.css) (a class-light semantic HTML CSS Framework). Perfect [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/), and [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app) scores. Here is a [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md) Page.
+A fast, lightweight, and modern [Zola](https://getzola.org) theme utilizing class-light semantic HTML with modular CSS. Perfect [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/), and [Observatory](https://developer.mozilla.org/en-US/observatory/analyze?host=abridge.netlify.app) scores. Here is a [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md) Page.
<!-- more -->
@@ -54,7 +54,7 @@ A fast, lightweight, and modern [Zola](https://getzola.org) theme utilizing [abr
## Quick Start
-This theme requires version {{ showdata(src="https://raw.githubusercontent.com/Jieiku/abridge/master/theme.toml" key="min_version" type="toml") }} or later of [Zola](https://www.getzola.org/documentation/getting-started/installation/)
+This theme requires version {{<showdata src="https://raw.githubusercontent.com/Jieiku/abridge/master/theme.toml" key="min_version" type="toml" page={page} config={config} />}} or later of [Zola](https://www.getzola.org/documentation/getting-started/installation/)
```bash
git clone https://github.com/jieiku/abridge.git
@@ -138,7 +138,7 @@ Zola will start the dev web server, accessible by default at `http://127.0.0.1:1
Saved changes will live reload in the browser. (press `ctrl+f5`, or while developing set `pwa=false` in `config.toml`)
-## Pagination {#pagination}
+## Pagination {% raw %}{#pagination}{% endraw %}
You can set the number of home page items by editing `content\_index.md` file and adjusting `paginate_by`
@@ -241,7 +241,7 @@ menu_footer = [
]
```
-### SEO and Header Tags {#seo}
+### SEO and Header Tags {% raw %}{#seo}{% endraw %}
You can review the SEO tags in the seo macro located at `templates/macros/seo.html`, all configurable values should be in `config.toml` under `config.extra` or in the content markdown files.
@@ -268,7 +268,7 @@ You can see a demo on [this page](https://abridge.netlify.app/overview-math/).
For better performance I recommend only enabling math on a [per page bases in your post.md files](https://github.com/Jieiku/abridge/blob/master/content/overview-math.md?plain=1#L11-L13), instead of in your main config.toml file.
-### PWA, Progressive Web App {#pwa}
+### PWA, Progressive Web App {% raw %}{#pwa}{% endraw %}
Abridge theme has PWA support. You can install the entire site as an app and have it work offline. To try it out simply use google chrome or your phone and go here: [abridge.netlify.app](https://abridge.netlify.app/)
diff --git a/content/overview-images/index.es.md b/content/overview-images/index.es.md
index 0f26e78..5fff0cc 100644
--- a/content/overview-images/index.es.md
+++ b/content/overview-images/index.es.md
@@ -42,45 +42,51 @@ Clases opcionales:
## Uso (misma ruta)
+{% raw %}
```rs
-{{/* img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") */}}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
+{% endraw %}
**Salida**
```html
-{{ img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
-{{ img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
## Uso (ruta relativa ./)
+{% raw %}
```rs
-{{/* img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") */}}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
+{% endraw %}
**Salida**
```html
-{{ img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
-{{ img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
## Uso (ruta raíz /)
+{% raw %}
```rs
-{{/* img(src="/images/ferris.svg" alt="Ferris the Rustacean") */}}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
```
+{% endraw %}
**Salida**
```html
-{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
```
-{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
# Imagen SVG directamente en el código
@@ -109,42 +115,48 @@ Al pasar el ratón sobre la imagen se mostrará la imagen a comparar.
## Uso (misma ruta)
+{% raw %}
```rs
-{{/* imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") */}}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
```
+{% endraw %}
**Salida**
```html
-{{ imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") }}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") }}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
## Uso (ruta relativa ./)
+{% raw %}
```rs
-{{/* imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") */}}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
```
+{% endraw %}
**Salida**
```html
-{{ imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") }}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") }}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
## Uso (ruta raíz /)
+{% raw %}
```rs
-{{/* imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") */}}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
```
+{% endraw %}
**Salida**
```html
-{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
diff --git a/content/overview-images/index.fr.md b/content/overview-images/index.fr.md
index ad77bf9..82c1bd6 100644
--- a/content/overview-images/index.fr.md
+++ b/content/overview-images/index.fr.md
@@ -42,45 +42,51 @@ Cours optionnels:
## Utilisation (même chemin)
+{% raw %}
```rs
-{{/* img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") */}}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
-{{ img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
## Utilisation (chemin relatif ./)
+{% raw %}
```rs
-{{/* img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") */}}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
-{{ img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
## Utilisation (chemin racine /)
+{% raw %}
```rs
-{{/* img(src="/images/ferris.svg" alt="Ferris the Rustacean") */}}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
```
+{% endraw %}
**Sortir**
```html
-{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
```
-{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
# Image SVG directement dans le code
@@ -109,42 +115,48 @@ Lorsque vous passez votre souris sur l'image, l'image à comparer s'affiche.
## Utilisation (même chemin)
+{% raw %}
```rs
-{{/* imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") */}}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
```
+{% endraw %}
**Sortir**
```html
-{{ imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") }}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") }}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
## Utilisation (chemin relatif ./)
+{% raw %}
```rs
-{{/* imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") */}}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
```
+{% endraw %}
**Sortir**
```html
-{{ imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") }}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") }}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
## Utilisation (chemin racine /)
+{% raw %}
```rs
-{{/* imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") */}}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
```
+{% endraw %}
**Sortir**
```html
-{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
diff --git a/content/overview-images/index.md b/content/overview-images/index.md
index c3cfd03..77a596b 100644
--- a/content/overview-images/index.md
+++ b/content/overview-images/index.md
@@ -42,45 +42,51 @@ Optional Classes:
## Usage (same path)
+{% raw %}
```rs
-{{/* img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") */}}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
-{{ img(src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="ferris-happy.svg" class="ci b1" alt="Ferris is Happy" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
## Usage (relative path ./)
+{% raw %}
```rs
-{{/* img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") */}}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
```
-{{ img(src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/") }}
+{{<img src="./img/ferris-gesture.svg" alt="Ferris says Hello" caption="Ferris" link="https://www.rust-lang.org/" page={page} config={config} />}}
## Usage (root path /)
+{% raw %}
```rs
-{{/* img(src="/images/ferris.svg" alt="Ferris the Rustacean") */}}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
```
-{{ img(src="/images/ferris.svg" alt="Ferris the Rustacean") }}
+{{<img src="/images/ferris.svg" alt="Ferris the Rustacean" page={page} config={config} />}}
# SVG image directly in code
@@ -109,42 +115,48 @@ When you hover your mouse over the image it will display the image to compare.
## Usage (same path)
+{% raw %}
```rs
-{{/* imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") */}}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") }}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="ferris.svg" swap_src="ferris-happy.svg") }}
+{{<imgswap main_src="ferris.svg" swap_src="ferris-happy.svg" page={page} config={config} />}}
## Usage (relative path ./)
+{% raw %}
```rs
-{{/* imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") */}}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") }}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg") }}
+{{<imgswap main_src="./img/ferris.svg" swap_src="./img/ferris-gesture.svg" page={page} config={config} />}}
## Usage (root path /)
+{% raw %}
```rs
-{{/* imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") */}}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
```
+{% endraw %}
**Output**
```html
-{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
```
-{{ imgswap(main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg") }}
+{{<imgswap main_src="/images/ferris.svg" swap_src="/images/ferris-gesture.svg" page={page} config={config} />}}
diff --git a/content/overview-math.es.md b/content/overview-math.es.md
index d2307cd..c716ece 100644
--- a/content/overview-math.es.md
+++ b/content/overview-math.es.md
@@ -76,17 +76,19 @@ Esta es la ecuación más bonita que he visto nunca:
### Uso
+{% raw %}
```rs
-{%/* katex(block=false) */%} e^{i\pi}+1=0 {%/* end */%}
+{% <katex block={false}> %}e^{i\pi}+1=0{% </katex> %}
```
+{% endraw %}
### Salida
```html
-{% katex(block=false) %} e^{i\pi}+1=0 {% end %}
+{% <katex block={false}> %} e^{i\pi}+1=0 {% </katex> %}
```
-{% katex(block=false) %} e^{i\pi}+1=0 {% end %}
+{% <katex block={false}> %} e^{i\pi}+1=0 {% </katex> %}
### Matemáticas en bloque
@@ -94,17 +96,35 @@ Un poco de Matemáticas en modo visualización es suficiente:
### Uso
+{% raw %}
```rs
-{%/* katex(block=true) */%} \int_0^1 x^2 dx {%/* end */%}
+{% <katex block={true}> %}\int_0^1 x^2 dx{% </katex> %}
```
+{% endraw %}
### Salida
```html
-{% katex(block=true) %} \int_0^1 x^2 dx {% end %}
+{% <katex block={true}> %} \int_0^1 x^2 dx {% </katex> %}
```
-{% katex(block=true) %} \int_0^1 x^2 dx {% end %}
+{% <katex block={true}> %} \int_0^1 x^2 dx {% </katex> %}
+
+### Uso
+
+{% raw %}
+```rs
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
+```
+{% endraw %}
+
+### Salida
+
+```html
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
+```
+
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
### Auto Render Inline
diff --git a/content/overview-math.fr.md b/content/overview-math.fr.md
index a26a5f0..f3e199d 100644
--- a/content/overview-math.fr.md
+++ b/content/overview-math.fr.md
@@ -76,17 +76,19 @@ C'est la plus belle équation que j'ai jamais vue:
### Usage
+{% raw %}
```rs
-{%/* katex(block=false) */%} e^{i\pi}+1=0 {%/* end */%}
+{% <katex block={false}> %}e^{i\pi}+1=0{% </katex> %}
```
+{% endraw %}
### Sortir
```html
-{% katex(block=false) %} e^{i\pi}+1=0 {% end %}
+{% <katex block={false}> %} e^{i\pi}+1=0 {% </katex> %}
```
-{% katex(block=false) %} e^{i\pi}+1=0 {% end %}
+{% <katex block={false}> %} e^{i\pi}+1=0 {% </katex> %}
### Bloquer les mathématiques
@@ -94,17 +96,35 @@ Certaines mathématiques en mode affichage sont assez justes :
### Usage
+{% raw %}
```rs
-{%/* katex(block=true) */%} \int_0^1 x^2 dx {%/* end */%}
+{% <katex block={true}> %}\int_0^1 x^2 dx{% </katex> %}
```
+{% endraw %}
### Sortir
```html
-{% katex(block=true) %} \int_0^1 x^2 dx {% end %}
+{% <katex block={true}> %} \int_0^1 x^2 dx {% </katex> %}
```
-{% katex(block=true) %} \int_0^1 x^2 dx {% end %}
+{% <katex block={true}> %} \int_0^1 x^2 dx {% </katex> %}
+
+### Usage
+
+{% raw %}
+```rs
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
+```
+{% endraw %}
+
+### Sortir
+
+```html
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
+```
+
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
### Rendu automatique en ligne
diff --git a/content/overview-math.md b/content/overview-math.md
index 3d29dd3..27ef78a 100644
--- a/content/overview-math.md
+++ b/content/overview-math.md
@@ -76,17 +76,19 @@ This is the most beautiful equation I've ever seen:
### Usage
+{% raw %}
```rs
-{%/* katex(block=false) */%} e^{i\pi}+1=0 {%/* end */%}
+{% <katex block={false}> %} e^{i\pi}+1=0 {% </katex> %}
```
+{% endraw %}
### Output
```html
-{% katex(block=false) %} e^{i\pi}+1=0 {% end %}
+{% <katex block={false}> %} e^{i\pi}+1=0 {% </katex> %}
```
-{% katex(block=false) %} e^{i\pi}+1=0 {% end %}
+{% <katex block={false}> %} e^{i\pi}+1=0 {% </katex> %}
### Block Mathematics
@@ -94,17 +96,35 @@ Some Mathematics in display mode is fair enough:
### Usage
+{% raw %}
```rs
-{%/* katex(block=true) */%} \int_0^1 x^2 dx {%/* end */%}
+{% <katex block={true}> %} \int_0^1 x^2 dx {% </katex> %}
```
+{% endraw %}
### Output
```html
-{% katex(block=true) %} \int_0^1 x^2 dx {% end %}
+{% <katex block={true}> %} \int_0^1 x^2 dx {% </katex> %}
```
-{% katex(block=true) %} \int_0^1 x^2 dx {% end %}
+{% <katex block={true}> %} \int_0^1 x^2 dx {% </katex> %}
+
+### Usage
+
+{% raw %}
+```rs
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
+```
+{% endraw %}
+
+### Output
+
+```html
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
+```
+
+{% <katex block={true}> %} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {% </katex> %}
### Auto Render Inline
diff --git a/content/overview-rich-content/index.es.md b/content/overview-rich-content/index.es.md
index fdafd67..42ffd2e 100644
--- a/content/overview-rich-content/index.es.md
+++ b/content/overview-rich-content/index.es.md
@@ -45,31 +45,35 @@ Se incluyen varios shortcodes personalizados para aumentar CommonMark. `video` l
### Uso
+{% raw %}
```rs
-{{/* video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) */}}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
+{% endraw %}
### Salida
```html
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
### Uso
+{% raw %}
```rs
-{{/* video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="¡Son más de 9000!") */}}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="¡Son más de 9000!" page={page} config={config} />}}
```
+{% endraw %}
### Salida
```html
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="¡Son más de 9000!") }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="¡Son más de 9000!" page={page} config={config} />}}
```
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="It's Over 9000!!") }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
## Imagen
@@ -95,17 +99,19 @@ La última imagen en la matriz `sources` se utiliza para crear una etiqueta `<im
### Uso
+{% raw %}
```rs
-{{/* image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="¡ES MÁS DE 9000!") */}}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="¡ES MÁS DE 9000!" page={page} config={config} />}}
```
+{% endraw %}
### Salida
```html
-{{ image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="¡ES MÁS DE 9000!") }}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="¡ES MÁS DE 9000!" page={page} config={config} />}}
```
-{{ image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="ITS OVER 9000!") }}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="ITS OVER 9000!" page={page} config={config} />}}
## GIF
@@ -118,17 +124,19 @@ menos fiable.
### Utilización
+{% raw %}
```rs
-{{/* gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) */}}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
+{% endraw %}
### Salida
```html
-{{ gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
-{{ gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
## Audio
@@ -155,28 +163,32 @@ El navegador reproducirá el primer tipo que admita, por lo que colocarlos en or
### Uso
+{% raw %}
```rs
-{{/* audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]) */}}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} page={page} config={config} />}}
```
+{% endraw %}
### Salida
```html
-{{ audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]) }}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} page={page} config={config} />}}
```
-{{ audio(sources=["over9000.ogg", "over9000.mp3"]) }}
+{{<audio sources={["over9000.ogg", "over9000.mp3"]} page={page} config={config} />}}
### Uso
+{% raw %}
```rs
-{{/* audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"] class="ci b1" caption="¡Son más de 9000!!") */}}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} class="ci b1" caption="¡Son más de 9000!!" page={page} config={config} />}}
```
+{% endraw %}
### Salida
```html
-{{ audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"] class="ci b1" caption="¡Son más de 9000!") }}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} class="ci b1" caption="¡Son más de 9000!" page={page} config={config} />}}
```
-{{ audio(sources=["over9000.ogg", "over9000.mp3"] class="ci b1" caption="It's Over 9000!!") }}
+{{<audio sources={["over9000.ogg", "over9000.mp3"]} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
diff --git a/content/overview-rich-content/index.fr.md b/content/overview-rich-content/index.fr.md
index acd9374..838280b 100644
--- a/content/overview-rich-content/index.fr.md
+++ b/content/overview-rich-content/index.fr.md
@@ -45,31 +45,35 @@ Plusieurs shortcodes personnalisés sont inclus pour améliorer CommonMark. `vid
### Utilisation
+{% raw %}
```rs
-{{/* video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) */}}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
+{% endraw %}
### Sortie
```html
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
### Utilisation
+{% raw %}
```rs
-{{/* video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="It's Over 9000!!") */}}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
+{% endraw %}
### Sortie
```html
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="It's Over 9000!!") }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="It's Over 9000!!") }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
## Image
@@ -95,17 +99,19 @@ La dernière image du tableau `sources` est utilisée pour créer une balise `<i
### Utilisation
+{% raw %}
```rs
-{{/* image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="ITS OVER 9000!") */}}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="ITS OVER 9000!" page={page} config={config} />}}
```
+{% endraw %}
### Sortie
```html
-{{ image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="ITS OVER 9000!") }}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="ITS OVER 9000!" page={page} config={config} />}}
```
-{{ image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="ITS OVER 9000!") }}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="ITS OVER 9000!" page={page} config={config} />}}
## GIF
@@ -118,17 +124,19 @@ moins fiable.
### Utilisation
+{% raw %}
```rs
-{{/* gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) */}}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
+{% endraw %}
### Sortie
```html
-{{ gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
-{{ gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
## Audio
@@ -155,28 +163,32 @@ Le navigateur lira le premier type qu'il prend en charge, donc les placer dans l
### Utilisation
+{% raw %}
```rs
-{{/* audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]) */}}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} page={page} config={config} />}}
```
+{% endraw %}
### Sortie
```html
-{{ audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]) }}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} page={page} config={config} />}}
```
-{{ audio(sources=["over9000.ogg", "over9000.mp3"]) }}
+{{<audio sources={["over9000.ogg", "over9000.mp3"]} page={page} config={config} />}}
### Utilisation
+{% raw %}
```rs
-{{/* audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"] class="ci b1" caption="It's Over 9000!!") */}}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
+{% endraw %}
### Sortie
```html
-{{ audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"] class="ci b1" caption="It's Over 9000!!") }}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
-{{ audio(sources=["over9000.ogg", "over9000.mp3"] class="ci b1" caption="It's Over 9000!!") }}
+{{<audio sources={["over9000.ogg", "over9000.mp3"]} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
diff --git a/content/overview-rich-content/index.md b/content/overview-rich-content/index.md
index 6049768..bed7472 100644
--- a/content/overview-rich-content/index.md
+++ b/content/overview-rich-content/index.md
@@ -45,31 +45,35 @@ Several custom shortcodes are included to augment CommonMark. `video`, `image`,
### Usage
+{% raw %}
```rs
-{{/* video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) */}}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
+{% endraw %}
### Output
```html
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
### Usage
+{% raw %}
```rs
-{{/* video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="It's Over 9000!!") */}}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
+{% endraw %}
### Output
```html
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="It's Over 9000!!") }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
-{{ video(sources=["over9000_av1.mp4", "over9000_vp9.webm"] muted="true" class="ci b1" caption="It's Over 9000!!") }}
+{{<video sources={["over9000_av1.mp4", "over9000_vp9.webm"]} muted={true} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
## Image
@@ -95,17 +99,19 @@ Each string in the `sources` array should be a path to an image file of a differ
### Usage
+{% raw %}
```rs
-{{/* image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="ITS OVER 9000!") */}}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="ITS OVER 9000!" page={page} config={config} />}}
```
+{% endraw %}
### Output
```html
-{{ image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="ITS OVER 9000!") }}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="ITS OVER 9000!" page={page} config={config} />}}
```
-{{ image(sources=["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"] w=640 h=480 alt="ITS OVER 9000!") }}
+{{<image sources={["over9000-960.avif", "over9000-640.avif", "over9000-400.avif", "over9000-640.webp"]} w={640} h={480} alt="ITS OVER 9000!" page={page} config={config} />}}
## GIF
@@ -118,17 +124,19 @@ less reliable.
### Usage
+{% raw %}
```rs
-{{/* gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) */}}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
+{% endraw %}
### Output
```html
-{{ gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
```
-{{ gif(sources=["over9000_av1.mp4", "over9000_vp9.webm"]) }}
+{{<gif sources={["over9000_av1.mp4", "over9000_vp9.webm"]} page={page} config={config} />}}
## Audio
@@ -155,28 +163,32 @@ The browser will play the first type it supports, so placing them in order of si
### Usage
+{% raw %}
```rs
-{{/* audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]) */}}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} page={page} config={config} />}}
```
+{% endraw %}
### Output
```html
-{{ audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]) }}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} page={page} config={config} />}}
```
-{{ audio(sources=["over9000.ogg", "over9000.mp3"]) }}
+{{<audio sources={["over9000.ogg", "over9000.mp3"]} page={page} config={config} />}}
### Usage
+{% raw %}
```rs
-{{/* audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"] class="ci b1" caption="It's Over 9000!!") */}}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
+{% endraw %}
### Output
```html
-{{ audio(sources=["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"] class="ci b1" caption="It's Over 9000!!") }}
+{{<audio sources={["over9000.ogg", "over9000.mp3", "over9000.flac", "over9000.wav"]} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
```
-{{ audio(sources=["over9000.ogg", "over9000.mp3"] class="ci b1" caption="It's Over 9000!!") }}
+{{<audio sources={["over9000.ogg", "over9000.mp3"]} class="ci b1" caption="It's Over 9000!!" page={page} config={config} />}}
diff --git a/content/overview-showdata.es.md b/content/overview-showdata.es.md
index 4e7db9e..705f9f0 100644
--- a/content/overview-showdata.es.md
+++ b/content/overview-showdata.es.md
@@ -32,4 +32,4 @@ Este tema requiere la versión &#123;&#123; showdata(src="../theme.toml" type="t
## Salida
-Este tema requiere la versión {{ showdata(src="../theme.toml" type="toml" key="min_version") }} o posterior de Zola.
+Este tema requiere la versión {{<showdata src="../theme.toml" type="toml" key="min_version" page={page} config={config} />}} o posterior de Zola.
diff --git a/content/overview-showdata.fr.md b/content/overview-showdata.fr.md
index ebbb1e1..f7038f6 100644
--- a/content/overview-showdata.fr.md
+++ b/content/overview-showdata.fr.md
@@ -32,4 +32,4 @@ Ce thème nécessite une version &#123;&#123; showdata(src="../theme.toml" type=
## Sortir
-Ce thème nécessite une version {{ showdata(src="../theme.toml" type="toml" key="min_version") }} ou plus tard de Zola.
+Ce thème nécessite une version {{<showdata src="../theme.toml" type="toml" key="min_version" page={page} config={config} />}} ou plus tard de Zola.
diff --git a/content/overview-showdata.md b/content/overview-showdata.md
index 6fec6b0..be1734e 100644
--- a/content/overview-showdata.md
+++ b/content/overview-showdata.md
@@ -32,4 +32,4 @@ This theme requires version &#123;&#123; showdata(src="../theme.toml" type="toml
## Output
-This theme requires version {{ showdata(src="../theme.toml" type="toml" key="min_version") }} or later of Zola.
+This theme requires version {{<showdata src="../theme.toml" type="toml" key="min_version" page={page} config={config} />}} or later of Zola.
diff --git a/content/pages/about.es.md b/content/pages/about.es.md
index 4259c26..550c6db 100644
--- a/content/pages/about.es.md
+++ b/content/pages/about.es.md
@@ -6,7 +6,7 @@ title = "Sobre"
+++
Este sitio proporciona una demostración del [tema abridge](https://github.com/Jieiku/abridge) de [Zola](https://www.getzola.org/), el generador de sitios estáticos.
-Abridge fue creado por [Jake G (jieiku)](https://github.com/Jieiku) para ser rápido y ligero, usando html semántico, un [abridge.css](https://github.com/Jieiku/abridge.css) de clase-ligera, y JS No Mandatorio.
+[Jake G (jieiku)](https://github.com/Jieiku) creó Abridge para que fuera rápido y ligero, utilizando HTML semántico, CSS con pocas clases y sin JavaScript obligatorio.
Casi la mitad de los temas de Zola bajo licencia MIT existentes sirvieron de inspiración para las caraterísticas y el diseño de este tema.
diff --git a/content/pages/about.fr.md b/content/pages/about.fr.md
index b748a52..4cdb7ba 100644
--- a/content/pages/about.fr.md
+++ b/content/pages/about.fr.md
@@ -6,7 +6,7 @@ title = "À propos"
+++
Ce site fournit une démo pour le thème [Abridge](https://github.com/Jieiku/abridge) de [Zola](https://www.getzola.org/), le générateur de site statique.
-Abridge a été créé par [Jake G (jieiku)](https://github.com/Jieiku) pour être rapide et léger, en utilisant du HTML sémantique, un [abridge.css](https://github.com/Jieiku/abridge.css) léger de classe et No Mandatory JS.
+Abridge a été créé par [Jake G (jieiku)](https://github.com/Jieiku) pour être rapide et léger, en utilisant du HTML sémantique, du CSS économe en classes et sans JavaScript obligatoire.
Près de la moitié des thèmes Zola MIT existants ont inspiré les fonctionnalités et la conception de ce thème.
diff --git a/content/pages/about.md b/content/pages/about.md
index abab132..0b12e2b 100644
--- a/content/pages/about.md
+++ b/content/pages/about.md
@@ -6,7 +6,7 @@ title = "About"
+++
This site provides a demo for the [abridge theme](https://github.com/Jieiku/abridge) for [Zola](https://www.getzola.org/) the static site generator.
-Abridge was created by [Jake G (jieiku)](https://github.com/Jieiku) to be fast and lightweight, using semantic html, a class-light [abridge.css](https://github.com/Jieiku/abridge.css), and No Mandatory JS.
+Abridge was created by [Jake G (jieiku)](https://github.com/Jieiku) to be fast and lightweight, using semantic html, and class-light css, and No Mandatory JS.
Nearly half of the existing Zola MIT themes were inspiration for features and design of this theme.
diff --git a/content/pages/about.pt.md b/content/pages/about.pt.md
index 34086d5..2d540d5 100644
--- a/content/pages/about.pt.md
+++ b/content/pages/about.pt.md
@@ -6,7 +6,7 @@ title = "Sobre"
+++
Este site fornece uma demonstração do [tema abridge](https://github.com/Jieiku/abridge) de [Zola](https://www.getzola.org/), o gerador de sites estáticos.
-Abridge foi criado por [Jake G (jieiku)](https://github.com/Jieiku) para ser rápido e leve, usando html semântico, um [abridge.css](https://github.com/Jieiku/abridge.css) de classe-leve, e JS Não Mandatório.
+O Abridge foi criado por [Jake G (jieiku)](https://github.com/Jieiku) para ser rápido e leve, utilizando HTML semântico, CSS com poucas classes e sem JavaScript obrigatório.
Quase a metade dos temas Zola sob licença MIT existentes serviram de inspiração para as características e o desenho deste tema.
diff --git a/content/video-streaming-sites/overview-embed-streamable.es.md b/content/video-streaming-sites/overview-embed-streamable.es.md
index a7e96f1..3944ce4 100644
--- a/content/video-streaming-sites/overview-embed-streamable.es.md
+++ b/content/video-streaming-sites/overview-embed-streamable.es.md
@@ -24,9 +24,11 @@ Zola tiene muchos shortcodes, y nuevos son facilmente añadidos, este ejemplo mu
### Uso
+{% raw %}
```rs
-{{/* streamable(id="92ok4") */}}
+{{<streamable id="92ok4" />}}
```
+{% endraw %}
- `id` - el id del vídeo (obligatorio)
- `class` - una clase para añadir al &lt;div&gt; que rodea al iframe (opcional)
@@ -35,7 +37,7 @@ Zola tiene muchos shortcodes, y nuevos son facilmente añadidos, este ejemplo mu
### Salida
```html
-{{ streamable(id="92ok4") }}
+{{<streamable id="92ok4" />}}
```
-{{ streamable(id="92ok4") }}
+{{<streamable id="92ok4" />}}
diff --git a/content/video-streaming-sites/overview-embed-streamable.fr.md b/content/video-streaming-sites/overview-embed-streamable.fr.md
index 4b4ad81..aa19056 100644
--- a/content/video-streaming-sites/overview-embed-streamable.fr.md
+++ b/content/video-streaming-sites/overview-embed-streamable.fr.md
@@ -24,9 +24,11 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem
### Usage
+{% raw %}
```rs
-{{/* streamable(id="92ok4") */}}
+{{<streamable id="92ok4" />}}
```
+{% endraw %}
- `id` - l'identifiant de la vidéo (obligatoire)
- `class` - une classe à ajouter au &lt;div&gt; entourant l'iframe (optionnel)
@@ -35,7 +37,7 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem
### Output
```html
-{{ streamable(id="92ok4") }}
+{{<streamable id="92ok4" />}}
```
-{{ streamable(id="92ok4") }}
+{{<streamable id="92ok4" />}}
diff --git a/content/video-streaming-sites/overview-embed-streamable.md b/content/video-streaming-sites/overview-embed-streamable.md
index f9a2fa6..5495968 100644
--- a/content/video-streaming-sites/overview-embed-streamable.md
+++ b/content/video-streaming-sites/overview-embed-streamable.md
@@ -24,9 +24,11 @@ Zola has many shortcodes, and new are easily added, this example shows streamabl
### Usage
+{% raw %}
```rs
-{{/* streamable(id="92ok4") */}}
+{{<streamable id="92ok4" />}}
```
+{% endraw %}
- `id` - the video id (mandatory)
- `class` - a class to add to the &lt;div&gt; surrounding the iframe (optional)
@@ -35,7 +37,7 @@ Zola has many shortcodes, and new are easily added, this example shows streamabl
### Output
```html
-{{ streamable(id="92ok4") }}
+{{<streamable id="92ok4" />}}
```
-{{ streamable(id="92ok4") }}
+{{<streamable id="92ok4" />}}
diff --git a/content/video-streaming-sites/overview-embed-vimeo.es.md b/content/video-streaming-sites/overview-embed-vimeo.es.md
index 99a91af..d7bde48 100644
--- a/content/video-streaming-sites/overview-embed-vimeo.es.md
+++ b/content/video-streaming-sites/overview-embed-vimeo.es.md
@@ -24,9 +24,11 @@ Zola tiene muchos shortcodes, y los nuevos se añaden fácilmente, este ejemplo
### Uso
+{% raw %}
```rs
-{{/* vimeo(id="514402648") */}}
+{{<vimeo id="514402648" />}}
```
+{% endraw %}
- `id` - el id del video (obligatorio)
- `class` - una clase para añadir al \<div\> que rodea el iframe (opcional)
@@ -39,7 +41,7 @@ Zola tiene muchos shortcodes, y los nuevos se añaden fácilmente, este ejemplo
### Salida
```html
-{{ vimeo(id="514402648") }}
+{{<vimeo id="514402648" />}}
```
-{{ vimeo(id="514402648") }}
+{{<vimeo id="514402648" />}}
diff --git a/content/video-streaming-sites/overview-embed-vimeo.fr.md b/content/video-streaming-sites/overview-embed-vimeo.fr.md
index 684fb76..2858b9d 100644
--- a/content/video-streaming-sites/overview-embed-vimeo.fr.md
+++ b/content/video-streaming-sites/overview-embed-vimeo.fr.md
@@ -24,9 +24,11 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem
### Usage
+{% raw %}
```rs
-{{/* vimeo(id="514402648") */}}
+{{<vimeo id="514402648" />}}
```
+{% endraw %}
- `id` - l'identifiant de la vidéo (obligatoire)
- `class` - une classe à ajouter au &lt;div&gt; entourant l'iframe (optionnel)
@@ -39,7 +41,7 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem
### Output
```html
-{{ vimeo(id="514402648") }}
+{{<vimeo id="514402648" />}}
```
-{{ vimeo(id="514402648") }}
+{{<vimeo id="514402648" />}}
diff --git a/content/video-streaming-sites/overview-embed-vimeo.md b/content/video-streaming-sites/overview-embed-vimeo.md
index cfc00de..ce6fd39 100644
--- a/content/video-streaming-sites/overview-embed-vimeo.md
+++ b/content/video-streaming-sites/overview-embed-vimeo.md
@@ -24,9 +24,11 @@ Zola has many shortcodes, and new are easily added, this example shows vimeo.
### Usage
+{% raw %}
```rs
-{{/* vimeo(id="514402648") */}}
+{{<vimeo id="514402648" />}}
```
+{% endraw %}
- `id` - the video id (mandatory)
- `class` - a class to add to the &lt;div&gt; surrounding the iframe (optional)
@@ -39,7 +41,7 @@ Zola has many shortcodes, and new are easily added, this example shows vimeo.
### Output
```html
-{{ vimeo(id="514402648") }}
+{{<vimeo id="514402648" />}}
```
-{{ vimeo(id="514402648") }}
+{{<vimeo id="514402648" />}}
diff --git a/content/video-streaming-sites/overview-embed-youtube.es.md b/content/video-streaming-sites/overview-embed-youtube.es.md
index db6764f..52d7119 100644
--- a/content/video-streaming-sites/overview-embed-youtube.es.md
+++ b/content/video-streaming-sites/overview-embed-youtube.es.md
@@ -24,9 +24,11 @@ Zola tiene muchos shortcodes, y nuevos son facilmente añadidos, este ejemplo mu
### Uso
+{% raw %}
```rs
-{{/* youtube(id="32gyFIWecuw") */}}
+{{<youtube id="32gyFIWecuw" />}}
```
+{% endraw %}
- `id` - el id del video (obligatorio)
- `playlist` - el id de la lista de reproducción (opcional)
@@ -38,7 +40,7 @@ Zola tiene muchos shortcodes, y nuevos son facilmente añadidos, este ejemplo mu
### Salida
```html
-{{ youtube(id="32gyFIWecuw") }}
+{{<youtube id="32gyFIWecuw" />}}
```
-{{ youtube(id="32gyFIWecuw") }}
+{{<youtube id="32gyFIWecuw" />}}
diff --git a/content/video-streaming-sites/overview-embed-youtube.fr.md b/content/video-streaming-sites/overview-embed-youtube.fr.md
index bd85d9b..1aa3230 100644
--- a/content/video-streaming-sites/overview-embed-youtube.fr.md
+++ b/content/video-streaming-sites/overview-embed-youtube.fr.md
@@ -24,9 +24,11 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem
### Usage
+{% raw %}
```rs
-{{/* youtube(id="32gyFIWecuw") */}}
+{{<youtube id="32gyFIWecuw" />}}
```
+{% endraw %}
- `id` - l'identifiant de la vidéo (obligatoire)
- `playlist` - l'identifiant de la playlist (optionnel)
@@ -38,7 +40,7 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem
### Output
```html
-{{ youtube(id="32gyFIWecuw") }}
+{{<youtube id="32gyFIWecuw" />}}
```
-{{ youtube(id="32gyFIWecuw") }}
+{{<youtube id="32gyFIWecuw" />}}
diff --git a/content/video-streaming-sites/overview-embed-youtube.md b/content/video-streaming-sites/overview-embed-youtube.md
index 86a83b9..183b744 100644
--- a/content/video-streaming-sites/overview-embed-youtube.md
+++ b/content/video-streaming-sites/overview-embed-youtube.md
@@ -24,9 +24,11 @@ Zola has many shortcodes, and new are easily added, this example shows youtube.
### Usage
+{% raw %}
```rs
-{{/* youtube(id="32gyFIWecuw") */}}
+{{<youtube id="32gyFIWecuw" />}}
```
+{% endraw %}
- `id` - the video id (mandatory)
- `playlist` - the playlist id (optional)
@@ -38,7 +40,7 @@ Zola has many shortcodes, and new are easily added, this example shows youtube.
### Output
```html
-{{ youtube(id="32gyFIWecuw") }}
+{{<youtube id="32gyFIWecuw" />}}
```
-{{ youtube(id="32gyFIWecuw") }}
+{{<youtube id="32gyFIWecuw" />}}
diff --git a/netlify.toml b/netlify.toml
index 25e6bfb..5a9a7d7 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -3,7 +3,7 @@ publish = "public"
command = "npm run abridge -- '--base-url https://abridge.netlify.app'"
[build.environment]
-ZOLA_VERSION = "0.19.1"
+ZOLA_VERSION = "0.23.3"
[context.deploy-preview]
command = "npm run abridge -- '--drafts --base-url https://abridge.netlify.app'"
diff --git a/package_abridge.js b/package_abridge.js
index e82eee8..7c7a893 100644
--- a/package_abridge.js
+++ b/package_abridge.js
@@ -8,10 +8,10 @@ const { exec } = require("child_process");
const { exit } = require('process');
const execPromise = util.promisify(exec);
-if (!(fs.existsSync('config.toml'))) {
- throw new Error('ERROR: cannot find config.toml!');
+if (!(fs.existsSync('zola.toml'))) {
+ throw new Error('ERROR: cannot find zola.toml!');
}
-const tomlString = String(fs.readFileSync('config.toml'));
+const tomlString = String(fs.readFileSync('zola.toml'));
const data = TOML.parse(tomlString);
const js_prestyle = data.extra.js_prestyle;
const js_switcher = data.extra.js_switcher;
@@ -54,7 +54,7 @@ async function execWrapper(cmd) {
console.log(stdout);
}
if (stderr) {
- console.log('ERROR: ' + stderr);
+ console.log(stderr);
}
}
@@ -63,16 +63,16 @@ async function abridge() {
const { replaceInFileSync } = await import('replace-in-file');
// set index_format for chosen search_library accordingly.
if (search_library === 'offline') {
- replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\"" });
+ replaceInFileSync({ files: 'zola.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\"" });
args = args + " -u \"" + __dirname + "\/public\""//set base_url to the path on disk for offline site.
} else if (search_library === 'elasticlunrjava') {
- replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\"" });
+ replaceInFileSync({ files: 'zola.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\"" });
} else if (search_library === 'elasticlunr') {
- replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_json\"" });
+ replaceInFileSync({ files: 'zola.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_json\"" });
} else if (search_library === 'pagefind') {
- replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\"" });
+ replaceInFileSync({ files: 'zola.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\"" });
} else if (search_library === 'tinysearch') {
- replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\"" });
+ replaceInFileSync({ files: 'zola.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\"" });
}
console.log('Zola Build to generate files for minification:');
@@ -104,11 +104,36 @@ async function abridge() {
var hash = Math.floor(new Date().getTime() / 1000);
fs.renameSync(path.join(__dirname, "static/js/pagefind-entry.json"), path.join(__dirname, "static/js/pagefind-entry-" + hash + ".json"));
- // original: var e=await(await fetch(this.basePath+"pagefind-entry.json?ts="+Date.now())).json();
- // new: var e=await(await fetch(this.basePath+"pagefind-entry-1723268715.json")).json();
- // Tricky regex, so I split it into two replaceInFileSync() calls, pull requests welcome if you can improve this.
- replaceInFileSync({ files: path.join(__dirname, "static/js/pagefind_search.js"), from: /pagefind-entry\.json\?ts=/g, to: "pagefind-entry-" + hash + "\.json" });
- replaceInFileSync({ files: path.join(__dirname, "static/js/pagefind_search.js"), from: /Date.now\(\)/g, to: "\"\"" });
+ // Pagefind builds the entry URL in several forms across versions, e.g.:
+ // this.basePath+"pagefind-entry.json?ts="+Date.now()
+ // `${this.basePath}pagefind-entry.json?ts=${Date.now()}`
+ // Replace those with a build-time hashed filename (no cache-bust query).
+ // Also strip import.meta (ESM-only) so the classic <script defer> bundle parses.
+ const pagefindSearchPath = path.join(__dirname, "static/js/pagefind_search.js");
+ let pfSearch = fs.readFileSync(pagefindSearchPath, "utf8");
+ const hashedEntry = "pagefind-entry-" + hash + ".json";
+ const before = pfSearch;
+ pfSearch = pfSearch
+ // template literal: pagefind-entry.json?ts=${Date.now()}
+ .replace(/pagefind-entry\.json\?ts=\$\{Date\.now\(\)\}/g, hashedEntry)
+ // template literal with any expression: pagefind-entry.json?ts=${...}
+ .replace(/pagefind-entry\.json\?ts=\$\{[^}]+\}/g, hashedEntry)
+ // concat / plain: pagefind-entry.json?ts=
+ .replace(/pagefind-entry\.json\?ts=/g, hashedEntry)
+ // leftover bare filename (if ?ts= already stripped elsewhere)
+ .replace(/pagefind-entry\.json/g, hashedEntry)
+ // Date.now() used only for that cache-bust (safe after entry URL rewrite)
+ .replace(/Date\.now\(\)/g, '""')
+ .replace(/import\.meta\.url/g, "undefined")
+ .replace(/import\.meta/g, "undefined");
+ if (before === pfSearch) {
+ console.warn("WARNING: no pagefind-entry/import.meta substitutions applied to pagefind_search.js");
+ } else if (!pfSearch.includes(hashedEntry)) {
+ console.warn("WARNING: hashed entry name not found in pagefind_search.js after patch:", hashedEntry);
+ } else {
+ console.log("Patched pagefind_search.js to use", hashedEntry);
+ }
+ fs.writeFileSync(pagefindSearchPath, pfSearch);
//copy to public so the files are included in the PWA cache list if necessary.
fs.copyFileSync(path.join(__dirname, "static/js/pagefind-entry-" + hash + ".json"), path.join(__dirname, "public/js/pagefind-entry-" + hash + ".json"))
@@ -124,7 +149,7 @@ async function abridge() {
// update from abridge theme.
fs.copyFileSync(bpath + 'static/sw.js', 'static/sw.js');
fs.copyFileSync(bpath + 'static/js/sw_load.js', 'static/js/sw_load.js');
- // Update settings in PWA javascript file, using options parsed from config.toml. sw.min.js?v=3.10.0", "++"
+ // Update settings in PWA javascript file, using options parsed from zola.toml. sw.min.js?v=3.10.0", "++"
if (fs.existsSync('static/js/sw_load.js')) {
sw_load_min = '.js?v=';
if (js_bundle) {
@@ -141,7 +166,7 @@ async function abridge() {
}
if (pwa_cache_all === true) {
- console.log('info: pwa_cache_all = true in config.toml, so caching the entire site.\n');
+ console.log('info: pwa_cache_all = true in zola.toml, so caching the entire site.\n');
// Generate array from the list of files, for the entire site.
var dir = 'public';
@@ -189,7 +214,7 @@ async function abridge() {
countMatches: true,
});
} else {
- throw new Error('ERROR: pwa requires that pwa_VER, pwa_NORM_TTL, pwa_LONG_TTL, pwa_TTL_NORM, pwa_TTL_LONG, pwa_TTL_EXEMPT are set in config.toml.');
+ throw new Error('ERROR: pwa requires that pwa_VER, pwa_NORM_TTL, pwa_LONG_TTL, pwa_TTL_NORM, pwa_TTL_LONG, pwa_TTL_EXEMPT are set in zola.toml.');
}
}
@@ -357,7 +382,7 @@ function minify(fileA, outfile) {
async function searchChange(searchOption) {
const { replaceInFileSync } = await import('replace-in-file');
- replaceInFileSync({ files: 'config.toml', from: /search_library.*=.*/g, to: 'search_library = \"' + searchOption + '\"' });
+ replaceInFileSync({ files: 'zola.toml', from: /^search_library\s*=.*/gm, to: 'search_library = \"' + searchOption + '\"' });
}
if (args === ' offline') {
@@ -429,13 +454,17 @@ async function createPagefindIndex() {
// Edit the pagefind to convert from MJS to CJS
const pagefindPath = path.join(__dirname, "static/js/pagefind.js");//source pagefind from node module
let pagefindContent = fs.readFileSync(pagefindPath, "utf8");
- // Remove 'import.meta.url' from the pagefind file and exports
+ // Pagefind uses import.meta.url (ESM-only). Abridge bundles into a classic
+ // <script defer> (not type=module), so strip import.meta or browsers throw
+ // "Cannot use import.meta outside a module". Fallback basePath still works.
pagefindContent = pagefindContent
.replace(
/initPrimary\(\)\{([^{}]*\{[^{}]*\})*[^{}]*\}/g,
`initPrimary(){}`
) // Remove annoying function
- .replace(/;export\{[^}]*\}/g, "");
+ .replace(/;export\{[^}]*\}/g, "")
+ .replace(/import\.meta\.url/g, "undefined")
+ .replace(/import\.meta/g, "undefined");
fs.writeFileSync(pagefindPath, pagefindContent);
// now insert the CJS into the anonymous function within pagefind.search.js
@@ -461,7 +490,7 @@ async function sync() {
return;
}
- // Checks for changes from local version in static, package.json and config.toml
+ // Checks for changes from local version in static, package.json and zola.toml
// and if there are changes it sync from the submodule
// Check for changes in static
@@ -522,8 +551,8 @@ async function sync() {
exit(1);
}
- const configToml = path.join(__dirname, "config.toml");
- const submoduleConfigToml = path.join(__dirname, "themes/abridge/config.toml");
+ const configToml = path.join(__dirname, "zola.toml");
+ const submoduleConfigToml = path.join(__dirname, "themes/abridge/zola.toml");
let adjustTomlContent = function (content) {
content = content.replace(/^\s+|\s+$|\s+(?=\s)/g, ""); // Remove all leading and trailing whitespaces and multiple whitespaces
@@ -548,7 +577,7 @@ async function sync() {
console.log(
"\x1b[34m%s\x1b[0m",
"info:",
- "The config.toml file format may have changed, please update it manually."
+ "The zola.toml file format may have changed, please update it manually."
);
}
}
diff --git a/sass/abridge.scss b/sass/abridge.scss
index f129214..aa729fd 100644
--- a/sass/abridge.scss
+++ b/sass/abridge.scss
@@ -1450,122 +1450,32 @@ $coderoundhighlight: false !default;//round corners on highlighted code blocks
}// center image, <center> does not pass validation, use: <img class="ci"></img>
}
@if $syntax {
- // Unstyled Text Color, and background color
.z-code {
- color: var(--h1);//#ccc
background-color: var(--h0);
- }
- // This is a comment
- .z-comment {//, .z-punctuation.z-definition.z-comment
- color: var(--h2);//#888
- font-style: italic;
- }
- // a (int a;)
- .z-variable {
- color: var(--h1);
- }
- // "This is a string"
- .z-string {//, .z-constant.z-other.z-symbol
- color: var(--h6);
- }
- // 10 (a = 10;)
- .z-constant.z-numeric {
- color: var(--h4);
- }
- // /n
- .z-constant.z-character.z-escape {//, .z-string.z-regexp
- color: var(--h7);
- }
- // false, true, etc...
- .z-constant.z-language {
- color: var(--h4);
- }
- // BUF (const BUF: usize = 10 * 1024;)
- .z-constant.z-other {//, .z-constant.z-character
- color: var(--h4);
- }
- // use, crate, let, etc.
- .z-keyword {//, .z-keyword.z-operator.z-word
- color: var(--h8);
- }
- // = * - + /
- .z-keyword.z-operator {
- color: var(--h9);
- }
- // separators: commas, colons, etc. terminator: endline semicolon, etc.
- .z-punctuation.z-separator, .z-punctuation.z-terminator {
- color: var(--h1);
- }
- // () [] {}
- .z-punctuation.z-section {
- color: var(--h1);
- }
- // . ::
- .z-punctuation.z-accessor {
- color: var(--h4);
- }
- // # (#[cfg(test)])
- .z-punctuation.z-definition.z-annotation {
color: var(--h1);
}
- // const, pub, mut, Self, fn
- .z-storage {
- color: var(--h8);
- }
- // const, struct
- .z-storage.z-type {
- color: var(--h8);
- }
- // new, function names
- .z-entity.z-name.z-function {
- color: var(--h5);
- }
- // key in toml entries
- .z-entity.z-name {//, .z-entity.z-name.z-label
- color: var(--h5);
- }
- // v1 (fn lookup(v1))
- .z-variable.z-parameter {
- color: var(--h4);
- }
- // self (self.html.push(c))
- .z-variable.z-language {
- color: var(--h5);
- font-style: italic;
- }
- // html tag name, eg: html, head, meta, title, body, etc.
- .z-entity.z-name.z-tag {//, .z-meta.z-tag.z-sgml
- color: var(--h8);
- }
- // html tag brackets <>
- .z-punctuation.z-definition.z-tag.z-end, .z-punctuation.z-definition.z-tag.z-begin, .z-punctuation.z-definition.z-tag {
- color: var(--h8);
- }
- // html attribute name, eg: lang, charset
- .z-entity.z-other.z-attribute-name {
- color: var(--h5);
- }
- // function name as variable value, and annotation: derive (#[derive(Debug)])
- .z-variable.z-function, .z-variable.z-annotation {
- color: var(--h5);
- }
- // support function, eg: extend (self.html.extend(b"<span");)
- // macros, eg: println! print! format!
- .z-support.z-function, .z-support.z-macro {
- color: var(--h3);
- }
- // type: Vec, Some, str, int
- // class: Config ($CONF = Config::getInstance()->getAll();)
- .z-support.z-type, .z-support.z-class {
- color: var(--h8);
- font-style: italic;
- }
- // property name, eg css: font-size, text-align, etc.
- .z-support.z-type.z-property-name {
- color: var(--h8);
+ .z-hl {
+ background-color: var(--h0);
+ filter: brightness(var(--ha));
}
- //json
- .z-key.z-json {
- color: var(--h4);
+
+ .giallo-ln {
+ color: var(--h2);
+ padding-right: 1em;
}
+
+ .z-1 { color: var(--h4); }
+ .z-2 { color: var(--h2); }
+ .z-3 { color: var(--h7); }
+ .z-4 { color: var(--h6); }
+ .z-5 { color: var(--h8); }
+ .z-6, .z-9 { color: var(--h3); }
+ .z-7 { color: var(--h5); }
+ .z-8 { color: var(--h9); }
+
+ .z-b { font-weight: bold; }
+ .z-i { font-style: italic; }
+ .z-u { text-decoration: underline; }
+ .z-s { text-decoration: line-through; }
+ .z-us { text-decoration: underline line-through; }
}
diff --git a/static/js/abridge.min.js b/static/js/abridge.min.js
index 003dc31..a9d097a 100644
--- a/static/js/abridge.min.js
+++ b/static/js/abridge.min.js
@@ -1 +1 @@
-let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var n=e[t].getAttribute("href"),n=atob(n.substring(1));e[t].href="mailto:"+n}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var l,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,C,D,F,k,L,_,N,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},g.Pipeline.prototype.reset=function(){this._queue=[]},g.Pipeline.prototype.get=function(){return this._queue},g.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return g.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(g.Index=function(){this._fields=[],this._ref="id",this.pipeline=new g.Pipeline,this.documentStore=new g.DocumentStore,this.index={},this.eventEmitter=new g.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=[].slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},g.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},g.Index.load=function(e){e.version!==g.version&&g.utils.warn("version mismatch: current "+g.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=g.DocumentStore.load(e.documentStore),n.pipeline=g.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=g.InvertedIndex.load(e.index[t]);return n},g.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new g.InvertedIndex,this},g.Index.prototype.setRef=function(e){return this._ref=e,this},g.Index.prototype.saveDocument=function(e){return this.documentStore=new g.DocumentStore(e),this},g.Index.prototype.addDoc=function(i,e){var r;i&&(e=void 0===e||e,r=i[this._ref],this.documentStore.addDoc(r,i),this._fields.forEach(function(e){var t,n=this.pipeline.run(g.tokenizer(i[e])),o=(this.documentStore.addFieldLength(r,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o)this.index[e].addToken(t,{ref:r,tf:Math.sqrt(o[t])})},this),e)&&this.eventEmitter.emit("add",i,this)},g.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},g.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n))&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(g.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t)&&this.eventEmitter.emit("remove",e,this)},g.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},g.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;return{}.hasOwnProperty.call(this._idfCache,n)?this._idfCache[n]:(t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1)),this._idfCache[n]=e)},g.Index.prototype.getFields=function(){return this._fields.slice()},g.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new g.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(g.tokenizer(e[u]))}var a,l={};for(a in o){var c=i[a]||i.any;if(c){var d=this.fieldSearch(c,a,o),h=o[a].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in l?l[p]+=d[p]:l[p]=d[p]}}var f,p,m=[];for(p in l)f={ref:p,score:l[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),m.push(f);return m.sort(function(e,t){return t.score-e.score}),m},g.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(l){var e=[l],c=(1==n&&(e=this.index[d].expandToken(l)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==l&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,a=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(a=e!=l?.15*(1-(e.length-l.length)/e.length):a);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},g.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},g.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},g.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},g.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:g.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},g.Index.prototype.use=function(e){var t=[].slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(g.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},g.DocumentStore.prototype.isDocStored=function(){return this._save},g.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?(e=>{if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n})(t):null},g.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},g.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},g.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},g.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},g.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},g.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},g.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},l={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},d=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,h=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,f=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$/,p=/^([^aeiou][^aeiouy]*)?[aeiouy]/,m=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,y=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,b=/(at|bl|iz)$/,w=/([^aeiouylsz])\1$/,I=RegExp("^"+(t="[^aeiou][^aeiouy]*")+(e="[aeiouy]")+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,C=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,N=RegExp("^"+t+e+"[^aeiouwxy]$"),g.Pipeline.registerFunction(g.stemmer=function(e){var t,n,o,i,r,s,u,a;return e.length<3||("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=v,(r=m).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=y).test(e)?(a=r.exec(e),(r=d).test(a[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(a=u.exec(e))[1],(u=p).test(s))&&(e=s,o=w,i=I,(u=b).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e")),(r=E).test(e)&&(e=(s=(a=r.exec(e))[1])+"i"),(r=C).test(e)&&(s=(a=r.exec(e))[1],t=a[2],(r=d).test(s))&&(e=s+l[t]),(r=D).test(e)&&(s=(a=r.exec(e))[1],t=a[2],(r=d).test(s))&&(e=s+c[t]),u=k,(r=F).test(e)?(s=(a=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(a=u.exec(e))[1]+a[2],(u=h).test(s))&&(e=s),(r=L).test(e)&&(s=(a=r.exec(e))[1],u=f,o=N,(r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s),u=h,(r=_).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n&&(e=n.toLowerCase()+e.substr(1))),e},"stemmer"),g.stopWordFilter=function(e){return e&&!0!==g.stopWordFilter.stopWords[e]?e:void 0},g.clearStopWords=function(){g.stopWordFilter.stopWords={}},g.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){g.stopWordFilter.stopWords[e]=!0},this)},g.resetStopWords=function(){g.stopWordFilter.stopWords=g.defaultStopWords},g.stopWordFilter.stopWords=g.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},g.Pipeline.registerFunction(g.stopWordFilter,"stopWordFilter"),g.Pipeline.registerFunction(g.trimmer=function(e){if(null==e)throw Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(g.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},g.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},g.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},g.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},g.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},g.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},g.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},g.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},g.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];t=t||[];if(null!=n||null!=(n=this.getNode(e)))for(var o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},g.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(g.Configuration=function(e,t){var n,e=e||"";if(null==t)throw Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){g.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},g.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)~t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):g.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},g.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},g.Configuration.prototype.get=function(){return this.config},g.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;i-1>=n&&r-1>=o;)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length<e.length?(t=e,this):(t=this,e),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return g},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=g:t.elasticlunr=g}(),window.onload=function(){function e(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0<i?i-1:0].focus()):40===t.keyCode&&(t.preventDefault(),n[e=1+i<o.length?1+i:i].focus())}}),document.addEventListener("click",function(e){u.contains(e.target)||u.classList.add("d-none")}),c=document.documentElement.getAttribute("lang").substring(0,2),"/"==(h=document.querySelector("meta[name='base']").getAttribute("content")).slice(-1)&&(h=h.slice(0,-1)),r.addEventListener("input",async function(){var n,e=this.value.trim(),o=(await(l=void 0===l?fetch(h+"/search_index."+c+".json").then(async function(e){return elasticlunr.Index.load(await e.json())}):l)).search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=u.childNodes,r=o.length,s=e.split(/\s+/);for(u.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=((e,t)=>{var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,a=s[p].split(/[\s\n]/),l=8;for(u in a){if(0<(v=a[u]).length){for(var c in n)elasticlunr.stemmer(v).startsWith(n[c])&&(l=40,o=!0);r.push([v,l,i]),l=2}i=i+v.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];for(d.push(f),p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var m=0;if(o)for(var g=0,p=d.length-1;0<=p;p--)g<d[p]&&(g=d[p],m=p);for(var v,y,S=[],x=r[m][2],p=m;p<m+h;p++){x<(v=r[p])[2]&&(S.push(e.substring(x,v[2])),x=v[2]),40===v[1]&&S.push("<mark>"),x=v[2]+v[0].length;40===v[1]||v[0].length<12||/^[\x00-\xff]+$/.test(v[0])?S.push(e.substring(v[2],x)):(y=((e,t)=>{for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var a=e.codePointAt(u).toString(16);if(o=4<a.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=b(a),u==e.length-1){if(t<(r+=i))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(r=(r+=i)+b(a),t<r)break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(r+=b(a),t<r)break;4<a.length?n+=e[u-1]+e[u]:n+=e[u],s=u+1}}return n})(e.substring(v[2],x),12),S.push(y)),40===v[1]&&S.push("</mark>")}return S.push("…"),S.join("")})(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)},"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.12.1",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file
+let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var n=e[t].getAttribute("href"),n=atob(n.substring(1));e[t].href="mailto:"+n}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=getCodeContent(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getCodeContent=e=>[...e.querySelectorAll(".giallo-l")].map(e=>{var e=e.cloneNode(!0),t=e.querySelector(".giallo-ln");return t&&t.remove(),e.textContent}).join("\n");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var l,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,C,D,F,k,L,_,N,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},g.Pipeline.prototype.reset=function(){this._queue=[]},g.Pipeline.prototype.get=function(){return this._queue},g.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return g.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(g.Index=function(){this._fields=[],this._ref="id",this.pipeline=new g.Pipeline,this.documentStore=new g.DocumentStore,this.index={},this.eventEmitter=new g.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=[].slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},g.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},g.Index.load=function(e){e.version!==g.version&&g.utils.warn("version mismatch: current "+g.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=g.DocumentStore.load(e.documentStore),n.pipeline=g.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=g.InvertedIndex.load(e.index[t]);return n},g.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new g.InvertedIndex,this},g.Index.prototype.setRef=function(e){return this._ref=e,this},g.Index.prototype.saveDocument=function(e){return this.documentStore=new g.DocumentStore(e),this},g.Index.prototype.addDoc=function(i,e){var r;i&&(e=void 0===e||e,r=i[this._ref],this.documentStore.addDoc(r,i),this._fields.forEach(function(e){var t,n=this.pipeline.run(g.tokenizer(i[e])),o=(this.documentStore.addFieldLength(r,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o)this.index[e].addToken(t,{ref:r,tf:Math.sqrt(o[t])})},this),e)&&this.eventEmitter.emit("add",i,this)},g.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},g.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n))&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(g.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t)&&this.eventEmitter.emit("remove",e,this)},g.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},g.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;return{}.hasOwnProperty.call(this._idfCache,n)?this._idfCache[n]:(t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1)),this._idfCache[n]=e)},g.Index.prototype.getFields=function(){return this._fields.slice()},g.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new g.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(g.tokenizer(e[u]))}var a,l={};for(a in o){var c=i[a]||i.any;if(c){var d=this.fieldSearch(c,a,o),h=o[a].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in l?l[p]+=d[p]:l[p]=d[p]}}var f,p,m=[];for(p in l)f={ref:p,score:l[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),m.push(f);return m.sort(function(e,t){return t.score-e.score}),m},g.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(l){var e=[l],c=(1==n&&(e=this.index[d].expandToken(l)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==l&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,a=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(a=e!=l?.15*(1-(e.length-l.length)/e.length):a);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},g.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},g.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},g.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},g.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:g.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},g.Index.prototype.use=function(e){var t=[].slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(g.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},g.DocumentStore.prototype.isDocStored=function(){return this._save},g.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?(e=>{if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n})(t):null},g.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},g.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},g.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},g.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},g.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},g.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},g.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},l={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},d=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,h=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,f=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$/,p=/^([^aeiou][^aeiouy]*)?[aeiouy]/,m=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,y=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,b=/(at|bl|iz)$/,w=/([^aeiouylsz])\1$/,I=RegExp("^"+(t="[^aeiou][^aeiouy]*")+(e="[aeiouy]")+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,C=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,N=RegExp("^"+t+e+"[^aeiouwxy]$"),g.Pipeline.registerFunction(g.stemmer=function(e){var t,n,o,i,r,s,u,a;return e.length<3||("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=v,(r=m).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=y).test(e)?(a=r.exec(e),(r=d).test(a[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(a=u.exec(e))[1],(u=p).test(s))&&(e=s,o=w,i=I,(u=b).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e")),(r=E).test(e)&&(e=(s=(a=r.exec(e))[1])+"i"),(r=C).test(e)&&(s=(a=r.exec(e))[1],t=a[2],(r=d).test(s))&&(e=s+l[t]),(r=D).test(e)&&(s=(a=r.exec(e))[1],t=a[2],(r=d).test(s))&&(e=s+c[t]),u=k,(r=F).test(e)?(s=(a=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(a=u.exec(e))[1]+a[2],(u=h).test(s))&&(e=s),(r=L).test(e)&&(s=(a=r.exec(e))[1],u=f,o=N,(r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s),u=h,(r=_).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n&&(e=n.toLowerCase()+e.substr(1))),e},"stemmer"),g.stopWordFilter=function(e){return e&&!0!==g.stopWordFilter.stopWords[e]?e:void 0},g.clearStopWords=function(){g.stopWordFilter.stopWords={}},g.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){g.stopWordFilter.stopWords[e]=!0},this)},g.resetStopWords=function(){g.stopWordFilter.stopWords=g.defaultStopWords},g.stopWordFilter.stopWords=g.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},g.Pipeline.registerFunction(g.stopWordFilter,"stopWordFilter"),g.Pipeline.registerFunction(g.trimmer=function(e){if(null==e)throw Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(g.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},g.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},g.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},g.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},g.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},g.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},g.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},g.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},g.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];t=t||[];if(null!=n||null!=(n=this.getNode(e)))for(var o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},g.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(g.Configuration=function(e,t){var n,e=e||"";if(null==t)throw Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){g.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},g.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)~t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):g.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},g.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},g.Configuration.prototype.get=function(){return this.config},g.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;i-1>=n&&r-1>=o;)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length<e.length?(t=e,this):(t=this,e),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return g},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=g:t.elasticlunr=g}(),window.onload=function(){function e(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0<i?i-1:0].focus()):40===t.keyCode&&(t.preventDefault(),n[e=1+i<o.length?1+i:i].focus())}}),document.addEventListener("click",function(e){u.contains(e.target)||u.classList.add("d-none")}),c=document.documentElement.getAttribute("lang").substring(0,2),"/"==(h=document.querySelector("meta[name='base']").getAttribute("content")).slice(-1)&&(h=h.slice(0,-1)),r.addEventListener("input",async function(){var n,e=this.value.trim(),o=(await(l=void 0===l?fetch(h+"/search_index."+c+".json").then(async function(e){return elasticlunr.Index.load(await e.json())}):l)).search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=u.childNodes,r=o.length,s=e.split(/\s+/);for(u.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=((e,t)=>{var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,a=s[p].split(/[\s\n]/),l=8;for(u in a){if(0<(v=a[u]).length){for(var c in n)elasticlunr.stemmer(v).startsWith(n[c])&&(l=40,o=!0);r.push([v,l,i]),l=2}i=i+v.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];for(d.push(f),p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var m=0;if(o)for(var g=0,p=d.length-1;0<=p;p--)g<d[p]&&(g=d[p],m=p);for(var v,y,S=[],x=r[m][2],p=m;p<m+h;p++){x<(v=r[p])[2]&&(S.push(e.substring(x,v[2])),x=v[2]),40===v[1]&&S.push("<mark>"),x=v[2]+v[0].length;40===v[1]||v[0].length<12||/^[\x00-\xff]+$/.test(v[0])?S.push(e.substring(v[2],x)):(y=((e,t)=>{for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var a=e.codePointAt(u).toString(16);if(o=4<a.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=b(a),u==e.length-1){if(t<(r+=i))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(r=(r+=i)+b(a),t<r)break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(r+=b(a),t<r)break;4<a.length?n+=e[u-1]+e[u]:n+=e[u],s=u+1}}return n})(e.substring(v[2],x),12),S.push(y)),40===v[1]&&S.push("</mark>")}return S.push("…"),S.join("")})(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)},"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.12.1",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file
diff --git a/static/js/abridge_nopwa.min.js b/static/js/abridge_nopwa.min.js
index fc3090c..e71dcf1 100644
--- a/static/js/abridge_nopwa.min.js
+++ b/static/js/abridge_nopwa.min.js
@@ -1 +1 @@
-let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var n=e[t].getAttribute("href"),n=atob(n.substring(1));e[t].href="mailto:"+n}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,C,D,F,k,L,_,N,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},g.Pipeline.prototype.reset=function(){this._queue=[]},g.Pipeline.prototype.get=function(){return this._queue},g.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return g.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(g.Index=function(){this._fields=[],this._ref="id",this.pipeline=new g.Pipeline,this.documentStore=new g.DocumentStore,this.index={},this.eventEmitter=new g.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=[].slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},g.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},g.Index.load=function(e){e.version!==g.version&&g.utils.warn("version mismatch: current "+g.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=g.DocumentStore.load(e.documentStore),n.pipeline=g.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=g.InvertedIndex.load(e.index[t]);return n},g.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new g.InvertedIndex,this},g.Index.prototype.setRef=function(e){return this._ref=e,this},g.Index.prototype.saveDocument=function(e){return this.documentStore=new g.DocumentStore(e),this},g.Index.prototype.addDoc=function(i,e){var r;i&&(e=void 0===e||e,r=i[this._ref],this.documentStore.addDoc(r,i),this._fields.forEach(function(e){var t,n=this.pipeline.run(g.tokenizer(i[e])),o=(this.documentStore.addFieldLength(r,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o)this.index[e].addToken(t,{ref:r,tf:Math.sqrt(o[t])})},this),e)&&this.eventEmitter.emit("add",i,this)},g.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},g.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n))&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(g.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t)&&this.eventEmitter.emit("remove",e,this)},g.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},g.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;return{}.hasOwnProperty.call(this._idfCache,n)?this._idfCache[n]:(t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1)),this._idfCache[n]=e)},g.Index.prototype.getFields=function(){return this._fields.slice()},g.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new g.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(g.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,m=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),m.push(f);return m.sort(function(e,t){return t.score-e.score}),m},g.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},g.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},g.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},g.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},g.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:g.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},g.Index.prototype.use=function(e){var t=[].slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(g.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},g.DocumentStore.prototype.isDocStored=function(){return this._save},g.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?(e=>{if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n})(t):null},g.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},g.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},g.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},g.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},g.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},g.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},g.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},d=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,h=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,f=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$/,p=/^([^aeiou][^aeiouy]*)?[aeiouy]/,m=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,y=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,b=/(at|bl|iz)$/,w=/([^aeiouylsz])\1$/,I=RegExp("^"+(t="[^aeiou][^aeiouy]*")+(e="[aeiouy]")+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,C=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,N=RegExp("^"+t+e+"[^aeiouwxy]$"),g.Pipeline.registerFunction(g.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3||("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=v,(r=m).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=y).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s))&&(e=s,o=w,i=I,(u=b).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e")),(r=E).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=C).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s))&&(e=s+a[t]),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s))&&(e=s+c[t]),u=k,(r=F).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s))&&(e=s),(r=L).test(e)&&(s=(l=r.exec(e))[1],u=f,o=N,(r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s),u=h,(r=_).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n&&(e=n.toLowerCase()+e.substr(1))),e},"stemmer"),g.stopWordFilter=function(e){return e&&!0!==g.stopWordFilter.stopWords[e]?e:void 0},g.clearStopWords=function(){g.stopWordFilter.stopWords={}},g.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){g.stopWordFilter.stopWords[e]=!0},this)},g.resetStopWords=function(){g.stopWordFilter.stopWords=g.defaultStopWords},g.stopWordFilter.stopWords=g.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},g.Pipeline.registerFunction(g.stopWordFilter,"stopWordFilter"),g.Pipeline.registerFunction(g.trimmer=function(e){if(null==e)throw Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(g.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},g.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},g.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},g.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},g.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},g.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},g.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},g.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},g.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];t=t||[];if(null!=n||null!=(n=this.getNode(e)))for(var o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},g.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(g.Configuration=function(e,t){var n,e=e||"";if(null==t)throw Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){g.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},g.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)~t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):g.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},g.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},g.Configuration.prototype.get=function(){return this.config},g.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;i-1>=n&&r-1>=o;)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length<e.length?(t=e,this):(t=this,e),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return g},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=g:t.elasticlunr=g}(),window.onload=function(){function e(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0<i?i-1:0].focus()):40===t.keyCode&&(t.preventDefault(),n[e=1+i<o.length?1+i:i].focus())}}),document.addEventListener("click",function(e){u.contains(e.target)||u.classList.add("d-none")}),c=document.documentElement.getAttribute("lang").substring(0,2),"/"==(h=document.querySelector("meta[name='base']").getAttribute("content")).slice(-1)&&(h=h.slice(0,-1)),r.addEventListener("input",async function(){var n,e=this.value.trim(),o=(await(l=void 0===l?fetch(h+"/search_index."+c+".json").then(async function(e){return elasticlunr.Index.load(await e.json())}):l)).search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=u.childNodes,r=o.length,s=e.split(/\s+/);for(u.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=((e,t)=>{var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(v=l[u]).length){for(var c in n)elasticlunr.stemmer(v).startsWith(n[c])&&(a=40,o=!0);r.push([v,a,i]),a=2}i=i+v.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];for(d.push(f),p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var m=0;if(o)for(var g=0,p=d.length-1;0<=p;p--)g<d[p]&&(g=d[p],m=p);for(var v,y,S=[],x=r[m][2],p=m;p<m+h;p++){x<(v=r[p])[2]&&(S.push(e.substring(x,v[2])),x=v[2]),40===v[1]&&S.push("<mark>"),x=v[2]+v[0].length;40===v[1]||v[0].length<12||/^[\x00-\xff]+$/.test(v[0])?S.push(e.substring(v[2],x)):(y=((e,t)=>{for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=b(l),u==e.length-1){if(t<(r+=i))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(r=(r+=i)+b(l),t<r)break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(r+=b(l),t<r)break;4<l.length?n+=e[u-1]+e[u]:n+=e[u],s=u+1}}return n})(e.substring(v[2],x),12),S.push(y)),40===v[1]&&S.push("</mark>")}return S.push("…"),S.join("")})(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)}; \ No newline at end of file
+let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var n=e[t].getAttribute("href"),n=atob(n.substring(1));e[t].href="mailto:"+n}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=getCodeContent(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getCodeContent=e=>[...e.querySelectorAll(".giallo-l")].map(e=>{var e=e.cloneNode(!0),t=e.querySelector(".giallo-ln");return t&&t.remove(),e.textContent}).join("\n");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,C,D,F,k,L,_,N,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},g.Pipeline.prototype.reset=function(){this._queue=[]},g.Pipeline.prototype.get=function(){return this._queue},g.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return g.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(g.Index=function(){this._fields=[],this._ref="id",this.pipeline=new g.Pipeline,this.documentStore=new g.DocumentStore,this.index={},this.eventEmitter=new g.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=[].slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},g.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},g.Index.load=function(e){e.version!==g.version&&g.utils.warn("version mismatch: current "+g.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=g.DocumentStore.load(e.documentStore),n.pipeline=g.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=g.InvertedIndex.load(e.index[t]);return n},g.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new g.InvertedIndex,this},g.Index.prototype.setRef=function(e){return this._ref=e,this},g.Index.prototype.saveDocument=function(e){return this.documentStore=new g.DocumentStore(e),this},g.Index.prototype.addDoc=function(i,e){var r;i&&(e=void 0===e||e,r=i[this._ref],this.documentStore.addDoc(r,i),this._fields.forEach(function(e){var t,n=this.pipeline.run(g.tokenizer(i[e])),o=(this.documentStore.addFieldLength(r,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o)this.index[e].addToken(t,{ref:r,tf:Math.sqrt(o[t])})},this),e)&&this.eventEmitter.emit("add",i,this)},g.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},g.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n))&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(g.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t)&&this.eventEmitter.emit("remove",e,this)},g.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},g.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;return{}.hasOwnProperty.call(this._idfCache,n)?this._idfCache[n]:(t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1)),this._idfCache[n]=e)},g.Index.prototype.getFields=function(){return this._fields.slice()},g.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new g.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(g.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,m=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),m.push(f);return m.sort(function(e,t){return t.score-e.score}),m},g.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},g.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},g.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},g.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},g.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:g.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},g.Index.prototype.use=function(e){var t=[].slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(g.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},g.DocumentStore.prototype.isDocStored=function(){return this._save},g.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?(e=>{if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n})(t):null},g.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},g.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},g.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},g.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},g.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},g.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},g.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},d=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,h=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,f=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$/,p=/^([^aeiou][^aeiouy]*)?[aeiouy]/,m=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,y=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,b=/(at|bl|iz)$/,w=/([^aeiouylsz])\1$/,I=RegExp("^"+(t="[^aeiou][^aeiouy]*")+(e="[aeiouy]")+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,C=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,N=RegExp("^"+t+e+"[^aeiouwxy]$"),g.Pipeline.registerFunction(g.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3||("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=v,(r=m).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=y).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s))&&(e=s,o=w,i=I,(u=b).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e")),(r=E).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=C).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s))&&(e=s+a[t]),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s))&&(e=s+c[t]),u=k,(r=F).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s))&&(e=s),(r=L).test(e)&&(s=(l=r.exec(e))[1],u=f,o=N,(r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s),u=h,(r=_).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n&&(e=n.toLowerCase()+e.substr(1))),e},"stemmer"),g.stopWordFilter=function(e){return e&&!0!==g.stopWordFilter.stopWords[e]?e:void 0},g.clearStopWords=function(){g.stopWordFilter.stopWords={}},g.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){g.stopWordFilter.stopWords[e]=!0},this)},g.resetStopWords=function(){g.stopWordFilter.stopWords=g.defaultStopWords},g.stopWordFilter.stopWords=g.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},g.Pipeline.registerFunction(g.stopWordFilter,"stopWordFilter"),g.Pipeline.registerFunction(g.trimmer=function(e){if(null==e)throw Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(g.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},g.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},g.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},g.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},g.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},g.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},g.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},g.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},g.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];t=t||[];if(null!=n||null!=(n=this.getNode(e)))for(var o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},g.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(g.Configuration=function(e,t){var n,e=e||"";if(null==t)throw Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){g.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},g.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)~t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):g.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},g.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},g.Configuration.prototype.get=function(){return this.config},g.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)r<e&&(t=i),e<r&&(n=i),r=this.elements[i=t+Math.floor((o=n-t)/2)];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;i-1>=n&&r-1>=o;)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length<e.length?(t=e,this):(t=this,e),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return g},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=g:t.elasticlunr=g}(),window.onload=function(){function e(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0<i?i-1:0].focus()):40===t.keyCode&&(t.preventDefault(),n[e=1+i<o.length?1+i:i].focus())}}),document.addEventListener("click",function(e){u.contains(e.target)||u.classList.add("d-none")}),c=document.documentElement.getAttribute("lang").substring(0,2),"/"==(h=document.querySelector("meta[name='base']").getAttribute("content")).slice(-1)&&(h=h.slice(0,-1)),r.addEventListener("input",async function(){var n,e=this.value.trim(),o=(await(l=void 0===l?fetch(h+"/search_index."+c+".json").then(async function(e){return elasticlunr.Index.load(await e.json())}):l)).search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=u.childNodes,r=o.length,s=e.split(/\s+/);for(u.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=((e,t)=>{var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(v=l[u]).length){for(var c in n)elasticlunr.stemmer(v).startsWith(n[c])&&(a=40,o=!0);r.push([v,a,i]),a=2}i=i+v.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];for(d.push(f),p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var m=0;if(o)for(var g=0,p=d.length-1;0<=p;p--)g<d[p]&&(g=d[p],m=p);for(var v,y,S=[],x=r[m][2],p=m;p<m+h;p++){x<(v=r[p])[2]&&(S.push(e.substring(x,v[2])),x=v[2]),40===v[1]&&S.push("<mark>"),x=v[2]+v[0].length;40===v[1]||v[0].length<12||/^[\x00-\xff]+$/.test(v[0])?S.push(e.substring(v[2],x)):(y=((e,t)=>{for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=b(l),u==e.length-1){if(t<(r+=i))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(r=(r+=i)+b(l),t<r)break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(r+=b(l),t<r)break;4<l.length?n+=e[u-1]+e[u]:n+=e[u],s=u+1}}return n})(e.substring(v[2],x),12),S.push(y)),40===v[1]&&S.push("</mark>")}return S.push("…"),S.join("")})(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)}; \ No newline at end of file
diff --git a/static/js/abridge_nosearch.min.js b/static/js/abridge_nosearch.min.js
index 30ef94e..5945e39 100644
--- a/static/js/abridge_nosearch.min.js
+++ b/static/js/abridge_nosearch.min.js
@@ -1 +1 @@
-let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var o=e[t].getAttribute("href"),o=atob(o.substring(1));e[t].href="mailto:"+o}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.12.1",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file
+let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var n=e[t].getAttribute("href"),n=atob(n.substring(1));e[t].href="mailto:"+n}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=getCodeContent(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getCodeContent=e=>[...e.querySelectorAll(".giallo-l")].map(e=>{var e=e.cloneNode(!0),t=e.querySelector(".giallo-ln");return t&&t.remove(),e.textContent}).join("\n");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.12.1",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file
diff --git a/static/js/abridge_nosearch_nopwa.min.js b/static/js/abridge_nosearch_nopwa.min.js
index 914a0e9..301d197 100644
--- a/static/js/abridge_nosearch_nopwa.min.js
+++ b/static/js/abridge_nosearch_nopwa.min.js
@@ -1 +1 @@
-let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var c=e[t].getAttribute("href"),c=atob(c.substring(1));e[t].href="mailto:"+c}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}); \ No newline at end of file
+let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var n=e[t].getAttribute("href"),n=atob(n.substring(1));e[t].href="mailto:"+n}})(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=getCodeContent(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getCodeContent=e=>[...e.querySelectorAll(".giallo-l")].map(e=>{var e=e.cloneNode(!0),t=e.querySelector(".giallo-ln");return t&&t.remove(),e.textContent}).join("\n");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}); \ No newline at end of file
diff --git a/static/js/codecopy.js b/static/js/codecopy.js
index 9e00c79..11d28e2 100644
--- a/static/js/codecopy.js
+++ b/static/js/codecopy.js
@@ -4,7 +4,7 @@ const changeIcon = (copyDiv, className) => {
};
const copyCodeAndChangeIcon = async (copyDiv, block) => {
- const code = block.querySelector('table') ? getTableCode(block) : getNonTableCode(block);
+ const code = getCodeContent(block);
try {
await navigator.clipboard.writeText(code);
changeIcon(copyDiv, "yes");
@@ -13,16 +13,15 @@ const copyCodeAndChangeIcon = async (copyDiv, block) => {
}
};
-const getNonTableCode = (block) => {
- return [...block.querySelectorAll('code')]
- .map(code => code.textContent)
- .join('');
-};
-
-const getTableCode = (block) => {
- return [...block.querySelectorAll('tr')]
- .map(row => row.querySelector('td:last-child')?.innerText ?? '')
- .join('');
+const getCodeContent = (block) => {
+ return [...block.querySelectorAll('.giallo-l')]
+ .map(line => {
+ const clone = line.cloneNode(true);
+ const ln = clone.querySelector('.giallo-ln');
+ if (ln) ln.remove();
+ return clone.textContent;
+ })
+ .join('\n');
};
document.querySelectorAll("pre").forEach((block) => {
@@ -30,5 +29,5 @@ document.querySelectorAll("pre").forEach((block) => {
copyDiv.className = "cc svgs svgh copy";
copyDiv.innerHTML = " ";
block.prepend(copyDiv);
- copyDiv.addEventListener("click", () => copyCodeAndChangeIcon(copyDiv, block));;
+ copyDiv.addEventListener("click", () => copyCodeAndChangeIcon(copyDiv, block));
});
diff --git a/static/js/search_tinysearch.min.js b/static/js/search_tinysearch.min.js
index 3ed4113..5abb86a 100644
--- a/static/js/search_tinysearch.min.js
+++ b/static/js/search_tinysearch.min.js
@@ -1 +1 @@
-window.onload=function(){if(document.body.contains(document.goSearch)){document.goSearch.onsubmit=function(){return goSearchNow()};{function n(){var e=document.querySelector("main"),n=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),t=n.cloneNode(!0),o=(t.id="results",document.createElement("div")),r='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value,"</h2></form>");return o.innerHTML=r,t.insertBefore(o,t.firstChild),e.innerHTML=t.outerHTML,n.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function v(){for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}function w(){return e=null!==e&&e.buffer===f.memory.buffer?e:new Uint8Array(f.memory.buffer)}async function o(e){var n=document.querySelector("meta[name='base']").getAttribute("content"),n=("/"==n.slice(-1)&&(n=n.slice(0,-1)),void 0===e&&(e=new URL(n+"/tinysearch_engine_bg.wasm")),{wbg:{}}),{instance:e,module:n}=(n.wbg.__wbindgen_json_parse=function(e,n){return e=JSON.parse((e=e,n=n,t.decode(w().subarray(e,e+n)))),h===g.length&&g.push(g.length+1),n=h,h=g[n],g[n]=e,n},await(async(e,n)=>{if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,n)}catch(n){if("application/wasm"==e.headers.get("Content-Type"))throw n}var t=await e.arrayBuffer();return WebAssembly.instantiate(t,n)}return(t=await WebAssembly.instantiate(e,n))instanceof WebAssembly.Instance?{instance:t,module:e}:t})(await(e="string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL?fetch(e):e),n));return f=e.exports,o.__wbindgen_wasm_module=n,f}var a=document.getElementById("searchinput"),r=(document.addEventListener("keydown",function(n){191===n.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(n.preventDefault(),a.focus(),suggestions.classList.remove("d-none")),27===n.keyCode&&(a.blur(),suggestions.classList.add("d-none"),v());var t=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==t.length){var o=[...t],r=o.indexOf(document.activeElement);let e=0;38===n.keyCode?(n.preventDefault(),t[e=0<r?r-1:0].focus()):40===n.keyCode&&(n.preventDefault(),t[e=1+r<o.length?1+r:r].focus())}}),!1);document.getElementById("searchinput").onfocus=function(){r||((async()=>{var e=document.querySelector("meta[name='base']").getAttribute("content");await o((e="/"==e.slice(-1)?e.slice(0,-1):e)+"/tinysearch_engine_bg.wasm")})(),r=!0),document.getElementById("searchinput").onfocus=""};let f,t=(document.getElementById("searchinput").addEventListener("input",function(e){var n=this.value;if(v(),!n)return!1;for(var t,o,r,a=document.getElementById("suggestions"),i=(o=99,t=((t,o,n)=>{if(void 0===n){let e=b.encode(t),n=o(e.length);return w().subarray(n,n+e.length).set(e),y=e.length,n}let r=t.length,a=o(r),i=w(),s=0;for(;s<r;s++){let e=t.charCodeAt(s);if(127<e)break;i[a+s]=e}if(s!==r){0!==s&&(t=t.slice(s)),a=n(a,r,r=s+3*t.length);let e=w().subarray(a+s,a+r);s+=p(t,e).written}return y=s,a})(t=n,f.__wbindgen_malloc,f.__wbindgen_realloc),r=y,(e=>{var n=(e=>g[e])(e);return e<36||(g[e]=h,h=e),n})(f.search(t,r,o))),s=0;s<i.length;s++){var c,u,l,d,m=i[s];(d=document.createElement("DIV")).innerHTML="<a href><span></span><span></span></a>",c=d.querySelector("a"),u=d.querySelector("span:first-child"),l=d.querySelector("span:nth-child(2)"),c.href=m[1]+"?q="+encodeURIComponent(n),u.innerHTML=m[0],l.innerHTML=m[2].replace(RegExp("(^|)("+n+")(|$)","ig"),"$1<mark>$2</mark>$3"),a.appendChild(d)}}),new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0})),e=(t.decode(),null),g=Array(32).fill(void 0),h=(g.push(void 0,null,!0,!1),g.length),y=0,b=new TextEncoder("utf-8"),p="function"==typeof b.encodeInto?function(e,n){return b.encodeInto(e,n)}:function(e,n){var t=b.encode(e);return n.set(t),{read:e.length,written:t.length}};document.goSearch.onsubmit=n}}}; \ No newline at end of file
+window.onload=function(){function m(){var e=document.querySelector("meta[name='base']").getAttribute("content");return(e=e&&"/"==e.slice(-1)?e.slice(0,-1):e)||""}async function e(){var e=m()+"/tinysearch_engine.wasm",n=await fetch(e);if(!n.ok)throw Error("Failed to fetch WASM: "+n.status+" "+n.statusText+" ("+e+")");if(e=await n.arrayBuffer(),n=await WebAssembly.instantiate(e),y=n.instance,g=y.exports.memory,p=y.exports.search,v=y.exports.free_search_result,!p||!v||!g)throw Error("Required WASM exports not found (need search, free_search_result, memory)");w=!0}function n(){var e=document.querySelector("main"),n=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),t=n.cloneNode(!0),r=(t.id="results",document.createElement("div")),o='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value,"</h2></form>");return r.innerHTML=o,t.insertBefore(r,t.firstChild),e.innerHTML=t.outerHTML,n.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function f(){for(;h.firstChild;)h.removeChild(h.firstChild)}var a,h,t,y,g,p,v,w,b,E;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},a=document.getElementById("searchinput"),h=document.getElementById("suggestions"),document.addEventListener("keydown",function(n){191===n.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(n.preventDefault(),a.focus(),h.classList.remove("d-none")),27===n.keyCode&&(a.blur(),h.classList.add("d-none"),f());var t=h.querySelectorAll("a");if(!h.classList.contains("d-none")&&0!==t.length){var r=[...t],o=r.indexOf(document.activeElement);let e=0;38===n.keyCode?(n.preventDefault(),t[e=0<o?o-1:0].focus()):40===n.keyCode&&(n.preventDefault(),t[e=1+o<r.length?1+o:o].focus())}}),t=!1,document.getElementById("searchinput").onfocus=function(){t||(e(),t=!0),document.getElementById("searchinput").onfocus=""},v=p=g=y=null,w=!1,b=new TextEncoder,E=new TextDecoder("utf-8"),document.getElementById("searchinput").addEventListener("input",function(e){var n=this.value;if(f(),!n)return!1;if(!w)return!1;for(var t=((e,n)=>{if(!w||!e)return[];n=n||10;try{var t,r,o=(e=>{var e=b.encode(e+"\0"),n=0;return n=(n=y.exports.__wbindgen_malloc?y.exports.__wbindgen_malloc(e.length):n)||1024,new Uint8Array(g.buffer,n,e.length).set(e),n})(e),a=p(o,n);return(y.exports.__wbindgen_free&&1024<o&&y.exports.__wbindgen_free(o,e.length+1),a)?(t=(e=>{if(!e)return null;for(var n=new Uint8Array(g.buffer),t=0;0!==n[e+t]&&++t<=10485760;);return E.decode(n.subarray(e,e+t))})(a),v(a),t&&Array.isArray(r=JSON.parse(t))?r:[]):[]}catch(e){return[]}})(n,99),r=0;r<t.length;r++){var o,a,i,c=t[r],c=Array.isArray(c)?(o=c[0],a=c[1],c[2]):(o=c.title,a=c.url,(e=>{if(!e)return"";if("string"==typeof e&&"{"==(e[0]||""))try{var n=JSON.parse(e);return n.meta||n.description||Object.values(n)[0]||""}catch(e){}return e})(c.meta||c.description||"")),u=((i=document.createElement("DIV")).innerHTML="<a href><span></span><span></span></a>",i.querySelector("a")),s=i.querySelector("span:first-child"),d=i.querySelector("span:nth-child(2)"),l=(n=>{if(!n)return n;var e,t=m();if(!t)return n;try{return"/"==(n[0]||"")?t+n:(e=new URL(n,t),new URL(t).origin+e.pathname+e.search+e.hash)}catch(e){return n}})(a);u.href=l+(~l.indexOf("?")?"&":"?")+"q="+encodeURIComponent(n),s.innerHTML=o||"",d.innerHTML=(u=n,(l=c||"")?(""+l).replace(RegExp("(^|)("+u+")(|$)","ig"),"$1<mark>$2</mark>$3"):""),h.appendChild(i)}}),document.goSearch.onsubmit=n)}; \ No newline at end of file
diff --git a/static/js/tinysearch.js b/static/js/tinysearch.js
index 183eb05..0a93d8f 100644
--- a/static/js/tinysearch.js
+++ b/static/js/tinysearch.js
@@ -2,252 +2,258 @@ window.onload = function () {
if (document.body.contains(document.goSearch)) {
document.goSearch.onsubmit = function () { return goSearchNow() };
- (function () {//anonymous function to keep from defining global variables.
-
+ (function () {
var searchinput = document.getElementById("searchinput");
- function suggestionFocus(e) {
- if (e.keyCode === 191//forward slash
- && document.activeElement.tagName !== "INPUT"
- && document.activeElement.tagName !== "TEXTAREA") {
- e.preventDefault();
- searchinput.focus();
- suggestions.classList.remove('d-none');
- }
+ var suggestions = document.getElementById("suggestions");
- if (e.keyCode === 27 ) {//escape
- searchinput.blur();
- suggestions.classList.add('d-none');
- closeAllLists();
+ function getBaseUrl() {
+ var baseUrl = document.querySelector("meta[name='base']").getAttribute("content");
+ if (baseUrl && baseUrl.slice(-1) == "/") {
+ baseUrl = baseUrl.slice(0, -1);
+ }
+ return baseUrl || "";
}
- const focusableSuggestions= suggestions.querySelectorAll('a');
- if (suggestions.classList.contains('d-none')
- || focusableSuggestions.length === 0) {
- return;
+ // Permalinks in the WASM index were baked at build time (zola base_url).
+ // Rewrite to the live site from <meta name="base"> so links match the current host.
+ function resolveResultUrl(url) {
+ if (!url) return url;
+ var baseUrl = getBaseUrl();
+ if (!baseUrl) return url;
+ try {
+ if (url.charAt(0) === "/") {
+ return baseUrl + url;
+ }
+ var parsed = new URL(url, baseUrl);
+ var base = new URL(baseUrl);
+ return base.origin + parsed.pathname + parsed.search + parsed.hash;
+ } catch (e) {
+ return url;
+ }
}
- const focusable= [...focusableSuggestions];
- const index = focusable.indexOf(document.activeElement);
- let nextIndex = 0;
+ function suggestionFocus(e) {
+ if (e.keyCode === 191
+ && document.activeElement.tagName !== "INPUT"
+ && document.activeElement.tagName !== "TEXTAREA") {
+ e.preventDefault();
+ searchinput.focus();
+ suggestions.classList.remove('d-none');
+ }
- if (e.keyCode === 38) {//up arrow
- e.preventDefault();
- nextIndex= index > 0 ? index-1 : 0;
- focusableSuggestions[nextIndex].focus();
- }
- else if (e.keyCode === 40) {//down arrow
- e.preventDefault();
- nextIndex= index+1 < focusable.length ? index+1 : index;
- focusableSuggestions[nextIndex].focus();
- }
+ if (e.keyCode === 27) {
+ searchinput.blur();
+ suggestions.classList.add('d-none');
+ closeAllLists();
+ }
+
+ const focusableSuggestions = suggestions.querySelectorAll('a');
+ if (suggestions.classList.contains('d-none')
+ || focusableSuggestions.length === 0) {
+ return;
+ }
+ const focusable = [...focusableSuggestions];
+ const index = focusable.indexOf(document.activeElement);
+
+ let nextIndex = 0;
+ if (e.keyCode === 38) {
+ e.preventDefault();
+ nextIndex = index > 0 ? index - 1 : 0;
+ focusableSuggestions[nextIndex].focus();
+ }
+ else if (e.keyCode === 40) {
+ e.preventDefault();
+ nextIndex = index + 1 < focusable.length ? index + 1 : index;
+ focusableSuggestions[nextIndex].focus();
+ }
}
document.addEventListener("keydown", suggestionFocus);
var loaded = false;
- document.getElementById('searchinput').onfocus = function() {
+ document.getElementById('searchinput').onfocus = function () {
if (!loaded) {
lazyLoad();
loaded = true;
}
document.getElementById('searchinput').onfocus = '';
- }
+ };
+
async function lazyLoad() {
- var baseUrl = document.querySelector("meta[name='base']").getAttribute("content");
- if (baseUrl.slice(-1) == "/") {
- baseUrl = baseUrl.slice(0, -1);
- }
- await init(baseUrl + "/tinysearch_engine_bg.wasm");
+ // Post-0.9 tinysearch (no wasm-pack): tinysearch_engine.wasm
+ await initWasm(getBaseUrl() + "/tinysearch_engine.wasm");
}
- // in page results when press enter or click search icon from search box
function closeSearchNow() {
const main = document.querySelector("main");
- main.innerHTML = window.main
+ main.innerHTML = window.main;
}
+
function goSearchNow() {
const main = document.querySelector("main");
if (!window.main) {
- window.main = main.innerHTML
- };
- var results = document.getElementById("suggestions");// suggestions div generated by search box
-
- var ResultsClone = results.cloneNode(true);// make a clone of the results, so that we can alter it
- ResultsClone.id = "results";// alter the id of our clone, so that we can apply different css style
-
- var headerDiv = document.createElement("div");// create a div element
-
- var headerContent = '<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value, "</h2></form>");// header to use at top of results page
+ window.main = main.innerHTML;
+ }
+ var results = document.getElementById("suggestions");
- headerDiv.innerHTML = headerContent;// document element div (headerDiv), set the inner contents to our header html (headerContent)
+ var ResultsClone = results.cloneNode(true);
+ ResultsClone.id = "results";
- ResultsClone.insertBefore(headerDiv, ResultsClone.firstChild);//insert our header div at the top of the page
+ var headerDiv = document.createElement("div");
+ var headerContent = '<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value, "</h2></form>");
+ headerDiv.innerHTML = headerContent;
+ ResultsClone.insertBefore(headerDiv, ResultsClone.firstChild);
- main.innerHTML = ResultsClone.outerHTML;//display ResultsClone.outerHTML as the page
- results.innerHTML = "";// clear the suggestions div popup
- document.getElementById("searchinput").value = "";// clear the search input box
- document.body.contains(document.closeSearch) && (document.closeSearch.onsubmit = function() { closeSearchNow() })
- return false
+ main.innerHTML = ResultsClone.outerHTML;
+ results.innerHTML = "";
+ document.getElementById("searchinput").value = "";
+ document.body.contains(document.closeSearch) && (document.closeSearch.onsubmit = function () { closeSearchNow() });
+ return false;
}
- /* Close search suggestion popup list */
function closeAllLists(elmnt) {
- var suggestions = document.getElementById("suggestions");
while (suggestions.firstChild) {
suggestions.removeChild(suggestions.firstChild);
}
}
function markTerm(input, term) {
- return input.replace(new RegExp('(^|)(' + term + ')(|$)','ig'), '$1<mark>$2</mark>$3');
+ if (!input) return "";
+ return String(input).replace(new RegExp('(^|)(' + term + ')(|$)', 'ig'), '$1<mark>$2</mark>$3');
}
- function autocomplete(inp) {
+ function unwrapMeta(meta) {
+ if (!meta) return "";
+ if (typeof meta === "string" && meta.charAt(0) === "{") {
+ try {
+ var m = JSON.parse(meta);
+ return m.meta || m.description || Object.values(m)[0] || "";
+ } catch (e) {
+ return meta;
+ }
+ }
+ return meta;
+ }
+ function autocomplete(inp) {
inp.addEventListener("input", function (e) {
- var suggestions, entry, i, val = this.value;
+ var entry, i, val = this.value;
- /*close any already open lists of autocompleted values*/
closeAllLists();
if (!val) {
return false;
}
+ if (!wasmReady) {
+ return false;
+ }
- suggestions = document.getElementById("suggestions");// suggestions div, generated by search box
-
- let arr = search(val, 99);//limit results
+ let arr = doSearch(val, 99);
for (i = 0; i < arr.length; i++) {
let elem = arr[i];
+ var title, url, meta;
+ if (Array.isArray(elem)) {
+ title = elem[0];
+ url = elem[1];
+ meta = elem[2];
+ } else {
+ title = elem.title;
+ url = elem.url;
+ meta = unwrapMeta(elem.meta || elem.description || "");
+ }
entry = document.createElement("DIV");
entry.innerHTML = '<a href><span></span><span></span></a>';
- var a, t, d;
- a = entry.querySelector('a'),
- t = entry.querySelector('span:first-child'),
- d = entry.querySelector('span:nth-child(2)');
- a.href = `${elem[1]}?q=${encodeURIComponent(val)}`;//a link
- //t.innerHTML = markTerm(elem[0], val);//title
- t.innerHTML = elem[0];//title
- d.innerHTML = markTerm(elem[2], val);//description
+ var a = entry.querySelector('a'),
+ t = entry.querySelector('span:first-child'),
+ d = entry.querySelector('span:nth-child(2)');
+ var resolved = resolveResultUrl(url);
+ a.href = resolved + (resolved.indexOf('?') >= 0 ? '&' : '?') + 'q=' + encodeURIComponent(val);
+ t.innerHTML = title || "";
+ d.innerHTML = markTerm(meta || "", val);
suggestions.appendChild(entry);
}
- })
+ });
}
+ // ---- New tinysearch WASM API (vanilla cargo build, no wasm-pack) ----
+ var wasmModule = null;
+ var memory = null;
+ var searchFunction = null;
+ var freeFunction = null;
+ var wasmReady = false;
+ var textEncoder = new TextEncoder();
+ var textDecoder = new TextDecoder("utf-8");
- let wasm, cachedTextDecoder = (autocomplete(document.getElementById("searchinput")), new TextDecoder("utf-8", {
- ignoreBOM: !0,
- fatal: !0
- })),
- cachegetUint8Memory0 = (cachedTextDecoder.decode(), null);
-
- function getUint8Memory0() {
- return cachegetUint8Memory0 = null !== cachegetUint8Memory0 && cachegetUint8Memory0.buffer === wasm.memory.buffer ? cachegetUint8Memory0 : new Uint8Array(wasm.memory.buffer)
+ function stringToWasmPtr(str) {
+ var bytes = textEncoder.encode(str + "\0");
+ var ptr = 0;
+ if (wasmModule.exports.__wbindgen_malloc) {
+ ptr = wasmModule.exports.__wbindgen_malloc(bytes.length);
+ }
+ if (!ptr) {
+ ptr = 1024;
+ }
+ new Uint8Array(memory.buffer, ptr, bytes.length).set(bytes);
+ return ptr;
}
- function getStringFromWasm0(e, t) {
- return cachedTextDecoder.decode(getUint8Memory0().subarray(e, e + t))
+ function wasmPtrToString(ptr) {
+ if (!ptr) return null;
+ var memoryArray = new Uint8Array(memory.buffer);
+ var length = 0;
+ while (memoryArray[ptr + length] !== 0) {
+ length++;
+ if (length > 10 * 1024 * 1024) break;
+ }
+ return textDecoder.decode(memoryArray.subarray(ptr, ptr + length));
}
- const heap = new Array(32).fill(void 0);
- heap.push(void 0, null, !0, !1);
- let heap_next = heap.length;
- function addHeapObject(e) {
- heap_next === heap.length && heap.push(heap.length + 1);
- var t = heap_next;
- return heap_next = heap[t], heap[t] = e, t
- }
- let WASM_VECTOR_LEN = 0,
- cachedTextEncoder = new TextEncoder("utf-8");
- const encodeString = "function" == typeof cachedTextEncoder.encodeInto ? function(e, t) {
- return cachedTextEncoder.encodeInto(e, t)
- } : function(e, t) {
- var n = cachedTextEncoder.encode(e);
- return t.set(n), {
- read: e.length,
- written: n.length
- }
- };
+ function doSearch(query, limit) {
+ if (!wasmReady || !query) return [];
+ limit = limit || 10;
+ try {
+ var queryPtr = stringToWasmPtr(query);
+ var resultPtr = searchFunction(queryPtr, limit);
- function passStringToWasm0(e, t, n) {
- if (void 0 === n) {
- const n = cachedTextEncoder.encode(e),
- a = t(n.length);
- return getUint8Memory0().subarray(a, a + n.length).set(n), WASM_VECTOR_LEN = n.length, a
- }
- let a = e.length,
- o = t(a);
- const i = getUint8Memory0();
- let r = 0;
- for (; r < a; r++) {
- const t = e.charCodeAt(r);
- if (127 < t) break;
- i[o + r] = t
- }
- if (r !== a) {
- 0 !== r && (e = e.slice(r)), o = n(o, a, a = r + 3 * e.length);
- const t = getUint8Memory0().subarray(o + r, o + a);
- r += encodeString(e, t).written
- }
- return WASM_VECTOR_LEN = r, o
- }
+ if (wasmModule.exports.__wbindgen_free && queryPtr > 1024) {
+ wasmModule.exports.__wbindgen_free(queryPtr, query.length + 1);
+ }
- function getObject(e) {
- return heap[e]
- }
+ if (!resultPtr) return [];
- function dropObject(e) {
- e < 36 || (heap[e] = heap_next, heap_next = e)
- }
+ var resultString = wasmPtrToString(resultPtr);
+ freeFunction(resultPtr);
- function takeObject(e) {
- var t = getObject(e);
- return dropObject(e), t
+ if (!resultString) return [];
+ var results = JSON.parse(resultString);
+ return Array.isArray(results) ? results : [];
+ } catch (err) {
+ console.error("tinysearch error:", err);
+ return [];
+ }
}
- function search(e, t) {
- var e = passStringToWasm0(e, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc),
- n = WASM_VECTOR_LEN;
- return takeObject(wasm.search(e, n, t))
- }
- async function load(e, t) {
- if ("function" == typeof Response && e instanceof Response) {
- if ("function" == typeof WebAssembly.instantiateStreaming) try {
- return await WebAssembly.instantiateStreaming(e, t)
- } catch (t) {
- if ("application/wasm" == e.headers.get("Content-Type")) throw t;
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", t)
- }
- var n = await e.arrayBuffer();
- return WebAssembly.instantiate(n, t)
+ async function initWasm(url) {
+ var response = await fetch(url);
+ if (!response.ok) {
+ throw new Error("Failed to fetch WASM: " + response.status + " " + response.statusText + " (" + url + ")");
}
- n = await WebAssembly.instantiate(e, t);
- return n instanceof WebAssembly.Instance ? {
- instance: n,
- module: e
- } : n
- }
- async function init(e) {
- var baseUrl = document.querySelector("meta[name='base']").getAttribute("content");
- if (baseUrl.slice(-1) == "/") {
- baseUrl = baseUrl.slice(0, -1);
+ var wasmBytes = await response.arrayBuffer();
+ var module = await WebAssembly.instantiate(wasmBytes);
+ wasmModule = module.instance;
+ memory = wasmModule.exports.memory;
+ searchFunction = wasmModule.exports.search;
+ freeFunction = wasmModule.exports.free_search_result;
+
+ if (!searchFunction || !freeFunction || !memory) {
+ throw new Error("Required WASM exports not found (need search, free_search_result, memory)");
}
- void 0 === e && (e = new URL(baseUrl + "/tinysearch_engine_bg.wasm"));
- const t = {
- wbg: {}
- };
- t.wbg.__wbindgen_json_parse = function(e, t) {
- return addHeapObject(JSON.parse(getStringFromWasm0(e, t)))
- };
- var {
- instance: e,
- module: n
- } = await load(await (e = "string" == typeof e || "function" == typeof Request && e instanceof Request || "function" == typeof URL && e instanceof URL ? fetch(e) : e), t);
- return wasm = e.exports, init.__wbindgen_wasm_module = n, wasm
+ wasmReady = true;
}
+ autocomplete(document.getElementById("searchinput"));
document.goSearch.onsubmit = function () { return goSearchNow() };
}());
}
diff --git a/static/sw.js b/static/sw.js
index d9cb4c7..b87f7ff 100644
--- a/static/sw.js
+++ b/static/sw.js
@@ -1,191 +1,191 @@
-class Pwa {
-
- constructor(self) {
- this.scope = self;
- const Version = new URL(location).searchParams.get("v");
- this.CACHE_VERSION = Version;
- //this.BASE_CACHE_FILES=['/js/theme.min.js','/js/theme_light.min.js','/abridge.css','/js/abridge.min.js','/','/404.html','/offline/','/manifest.json'];
- this.BASE_CACHE_FILES = ['/','/404.html','/about/','/abridge.css','/android-chrome-192x192.png','/android-chrome-512x512.png','/apple-touch-icon.png','/archive/','/atom.xml','/banner.png','/blog/','/blog/page/1/','/browserconfig.xml','/contact/','/elasticlunr.min.js','/es/','/es/about/','/es/archive/','/es/atom.xml','/es/blog/','/es/blog/page/1/','/es/contact/','/es/page/1/','/es/privacy/','/es/tags/','/es/tags/features/','/es/tags/features/atom.xml','/es/tags/shortcodes/','/es/tags/shortcodes/atom.xml','/es/tags/video/','/es/tags/video/atom.xml','/es/video-streaming-sites/overview-embed-streamable/','/favicon-16x16.png','/favicon-32x32.png','/favicon.ico','/favicon.svg','/fonts/KaTeX_AMS-Regular.woff2','/fonts/KaTeX_Caligraphic-Bold.woff2','/fonts/KaTeX_Caligraphic-Regular.woff2','/fonts/KaTeX_Fraktur-Bold.woff2','/fonts/KaTeX_Fraktur-Regular.woff2','/fonts/KaTeX_Main-Bold.woff2','/fonts/KaTeX_Main-BoldItalic.woff2','/fonts/KaTeX_Main-Italic.woff2','/fonts/KaTeX_Main-Regular.woff2','/fonts/KaTeX_Math-BoldItalic.woff2','/fonts/KaTeX_Math-Italic.woff2','/fonts/KaTeX_SansSerif-Bold.woff2','/fonts/KaTeX_SansSerif-Italic.woff2','/fonts/KaTeX_SansSerif-Regular.woff2','/fonts/KaTeX_Script-Regular.woff2','/fonts/KaTeX_Size1-Regular.woff2','/fonts/KaTeX_Size2-Regular.woff2','/fonts/KaTeX_Size3-Regular.woff2','/fonts/KaTeX_Size4-Regular.woff2','/fonts/KaTeX_Typewriter-Regular.woff2','/fonts/Roboto-Bold.woff2','/fonts/Roboto-Italic.woff2','/fonts/Roboto-Mono-Italic.woff2','/fonts/Roboto-Mono.woff2','/fonts/Roboto.woff2','/fr/','/fr/about/','/fr/archive/','/fr/atom.xml','/fr/blog/','/fr/blog/page/1/','/fr/contact/','/fr/offline/','/fr/overview-code-blocks/','/fr/overview-images/','/fr/overview-images/corro.svg','/fr/overview-images/ferris-gesture.png','/fr/overview-images/ferris-gesture.svg','/fr/overview-images/ferris-happy.svg','/fr/overview-images/ferris.svg','/fr/overview-images/img/ferris-gesture.svg','/fr/overview-images/img/ferris.svg','/fr/overview-markdown-and-style/','/fr/overview-math/','/fr/overview-rich-content/','/fr/overview-rich-content/over9000-400.avif','/fr/overview-rich-content/over9000-640.avif','/fr/overview-rich-content/over9000-640.webp','/fr/overview-rich-content/over9000-960.avif','/fr/overview-rich-content/over9000.mp3','/fr/overview-rich-content/over9000.ogg','/fr/overview-rich-content/over9000_av1.mp4','/fr/overview-rich-content/over9000_vp9.webm','/fr/overview-showdata/','/fr/page/1/','/fr/page/2/','/fr/page/3/','/fr/privacy/','/fr/tags/','/fr/tags/audio/','/fr/tags/audio/atom.xml','/fr/tags/data/','/fr/tags/data/atom.xml','/fr/tags/features/','/fr/tags/features/atom.xml','/fr/tags/images/','/fr/tags/images/atom.xml','/fr/tags/markdown/','/fr/tags/markdown/atom.xml','/fr/tags/mathematics/','/fr/tags/mathematics/atom.xml','/fr/tags/shortcodes/','/fr/tags/shortcodes/atom.xml','/fr/tags/video/','/fr/tags/video/atom.xml','/fr/video-streaming-sites/overview-embed-streamable/','/fr/video-streaming-sites/overview-embed-vimeo/','/fr/video-streaming-sites/overview-embed-youtube/','/images/ferris-gesture.svg','/images/ferris.svg','/js/abridge.min.js','/js/abridge_nopwa.min.js','/js/abridge_nosearch.min.js','/js/abridge_nosearch_nopwa.min.js','/js/codecopy.js','/js/elasticlunr.min.js','/js/email.js','/js/katex-auto-render.min.js','/js/katex.min.js','/js/katexbundle.min.js','/js/katexoptions.js','/js/lunr.da.js','/js/lunr.da.min.js','/js/lunr.de.js','/js/lunr.de.min.js','/js/lunr.du.js','/js/lunr.du.min.js','/js/lunr.es.js','/js/lunr.es.min.js','/js/lunr.fi.js','/js/lunr.fi.min.js','/js/lunr.fr.js','/js/lunr.fr.min.js','/js/lunr.hu.js','/js/lunr.hu.min.js','/js/lunr.it.js','/js/lunr.it.min.js','/js/lunr.jp.js','/js/lunr.jp.min.js','/js/lunr.no.js','/js/lunr.no.min.js','/js/lunr.pt.js','/js/lunr.pt.min.js','/js/lunr.ro.js','/js/lunr.ro.min.js','/js/lunr.ru.js','/js/lunr.ru.min.js','/js/lunr.stemmer.support.js','/js/lunr.stemmer.support.min.js','/js/lunr.sv.js','/js/lunr.sv.min.js','/js/lunr.tr.js','/js/lunr.tr.min.js','/js/lunr.zh.js','/js/lunr.zh.min.js','/js/mathtex-script-type.min.js','/js/pagefind.search.js','/js/prestyle.js','/js/search.js','/js/search_elasticlunr.min.js','/js/search_tinysearch.min.js','/js/searchjava.js','/js/searchjavaugly.js','/js/sw_load.js','/js/sw_load.min.js','/js/theme.js','/js/theme.min.js','/js/theme_button.js','/js/theme_light.js','/js/theme_light.min.js','/js/tinysearch.js','/katex.min.css','/m1024.png','/m128.png','/m192.png','/m384.png','/m48.png','/m512.png','/m72.png','/m96.png','/manifest.json','/manifest.min.json','/mstile-150x150.png','/nojs.css','/offline/','/overview-abridge/','/overview-abridge/lighthouse.png','/overview-code-blocks/','/overview-images/','/overview-images/corro.svg','/overview-images/ferris-gesture.png','/overview-images/ferris-gesture.svg','/overview-images/ferris-happy.svg','/overview-images/ferris.svg','/overview-images/img/ferris-gesture.svg','/overview-images/img/ferris.svg','/overview-markdown-and-style/','/overview-math/','/overview-rich-content/','/overview-rich-content/over9000-400.avif','/overview-rich-content/over9000-640.avif','/overview-rich-content/over9000-640.webp','/overview-rich-content/over9000-960.avif','/overview-rich-content/over9000.mp3','/overview-rich-content/over9000.ogg','/overview-rich-content/over9000_av1.mp4','/overview-rich-content/over9000_vp9.webm','/overview-showdata/','/page/1/','/page/2/','/page/3/','/page/4/','/privacy/','/pt/','/pt/about/','/pt/contact/','/pt/page/1/','/pt/privacy/','/robots.txt','/safari-pinned-tab.svg','/search_index.en.json','/search_index.es.json','/search_index.fr.json','/search_index.pt.json','/sitemap.xml','/tags/','/tags/audio/','/tags/audio/atom.xml','/tags/config/','/tags/config/atom.xml','/tags/data/','/tags/data/atom.xml','/tags/features/','/tags/features/atom.xml','/tags/images/','/tags/images/atom.xml','/tags/markdown/','/tags/markdown/atom.xml','/tags/mathematics/','/tags/mathematics/atom.xml','/tags/shortcodes/','/tags/shortcodes/atom.xml','/tags/video/','/tags/video/atom.xml','/tinysearch_engine_bg.wasm','/video-streaming-sites/overview-embed-streamable/','/video-streaming-sites/overview-embed-vimeo/','/video-streaming-sites/overview-embed-youtube/'];
- this.host = `${self.location.protocol}//${self.location.host}`;
- console.info(`Host: ${this.host}`);
- this.OFFLINE_PAGE = '/offline/';
- this.NOT_FOUND_PAGE = '/404.html';
- this.CACHE_NAME = `content-v${this.CACHE_VERSION}`;
- // 3600=1hour, 28800=8hours, 86400=1day, 604800=1week, 1209600=2weeks
- this.NORM_TTL = 0;
- this.LONG_TTL = 0;
- // keep the ttl on these lower:
- this.TTL_NORM = ["sw.min.js", "sw_load.min.js"];
- // rarely change, may be a good idea to periodically refresh, incase I change these and forget to increment service worker version:
- this.TTL_LONG = ["jpg", "jpeg", "png", "gif", "webp", "avif", "ico", "svg", "xsl", "txt"];
- // never change, cache forever unless service worker version is incremented:
- this.TTL_EXEMPT = ["js", "css", "otf", "eot", "ttf", "woff", "woff2", "mp4", "webm", "mp3", "ogg"];
- // skip these extensions so they expire same time as html: st,wasm,json(search), xml(sitemap,atom,rss)
- }
-
- canCache(url) {
- if (url.startsWith("http://localhost")) {
- return false;
- }
- const result = url.toString().startsWith(this.host);
- return result;
- }
-
- getFileExtension(url) {
- const extension = url.split('.').reverse()[0].split('?')[0];
- return (extension.endsWith('/')) ? '/' : extension;
- }
- getFileName(url) {
- const filename = url.substring(url.lastIndexOf('/') + 1).split('?')[0];
- return (filename.endsWith('/')) ? '/' : filename;
- }
-
- getTTL(url) {
- if (typeof url === 'string') {
- const extension = this.getFileExtension(url);
- const filename = this.getFileName(url);
-
- if (this.TTL_NORM.indexOf(filename) > -1) {
- console.info(url + ' contains a TTL_NORM filename');
- return this.NORM_TTL;
- }
- if (this.TTL_LONG.indexOf(extension) > -1) {
- console.info(url + ' contains a TTL_LONG extension');
- return this.LONG_TTL;
- }
- if (this.TTL_EXEMPT.indexOf(extension) > -1) {
- console.info(url + ' contains a TTL_EXEMPT extension');
- return null;
- }
- console.info(url + ' TTL_NORM');
- return this.NORM_TTL;
- }
- return null;
- }
-
- async installServiceWorker() {
- try {
- await caches.open(this.CACHE_NAME).then((cache) => {
- return cache.addAll(this.BASE_CACHE_FILES);
- }, err => console.error(`Error with ${this.CACHE_NAME}`, err));
- return this.scope.skipWaiting();
- }
- catch (err) {
- return console.error("Error with installation: ", err);
- }
- }
-
- cleanupLegacyCache() {
-
- const currentCaches = [this.CACHE_NAME];
-
- return new Promise(
- (resolve, reject) => {
- caches.keys()
- .then((keys) => keys.filter((key) => !~currentCaches.indexOf(key)))
- .then((legacy) => {
- if (legacy.length) {
- Promise.all(legacy.map((legacyKey) => caches.delete(legacyKey))
- ).then(() => resolve()).catch((err) => {
- console.error("Error in legacy cleanup: ", err);
- reject(err);
- });
- } else {
- resolve();
- }
- }).catch((err) => {
- console.error("Error in legacy cleanup: ", err);
- reject(err);
- });
- });
- }
-
- async preCacheUrl(url) {
- const cache = await caches.open(this.CACHE_NAME);
- const response = await cache.match(url);
- if (!response) {
- return fetch(url).then(resp => cache.put(url, resp.clone()));
- }
- return null;
- }
-
- register() {
- this.scope.addEventListener('install', event => {
- event.waitUntil(
- Promise.all([
- this.installServiceWorker(),
- this.scope.skipWaiting(),
- ]));
- console.info('SW Installed');
- });
-
- this.scope.addEventListener('activate', event => {
- event.waitUntil(Promise.all(
- [this.cleanupLegacyCache(),
- this.scope.clients.claim(),
- this.scope.skipWaiting()]).catch((err) => {
- console.error("Activation error: ", err);
- event.skipWaiting();
- }));
- });
-
- this.scope.addEventListener('fetch', event => {
- event.respondWith(
- caches.open(this.CACHE_NAME).then(async cache => {
- // check if this is NOT a resource we allow cacheing (some other domain), if so fetch it instead of cache.
- if (!this.canCache(event.request.url)) {
- return fetch(event.request);
- }
- // check the cache for the requested resource
- const response = await cache.match(event.request);
- if (response) {
- const headers = response.headers.entries();
- let date = null;
- for (let pair of headers) {
- if (pair[0] === 'date') {
- date = new Date(pair[1]);
- break;
- }
- }
- // date is not working, so ignore TTL and just serve the cached resource.
- if (!date) {
- return response;
- }
- const age = parseInt(((new Date().getTime() - date.getTime()) / 1000).toString());
- const ttl = this.getTTL(event.request.url);
- if (ttl === null || (ttl && age < ttl)) {
- // return the resource if it is not beyond the TTL
- return response;
- }
- }
- // if we made it here then we either did not have the cache, or the TTL was expired.
- return fetch(event.request.clone()).then(resp => {
- if (resp.status < 400) {
- if (this.canCache(event.request.url)) {
- cache.put(event.request, resp.clone());
- }
- return resp;
- }
- else {
- return cache.match(this.NOT_FOUND_PAGE);
- }
- }).catch(err => {
- // if we made it here then we were unable to fetch the resource.
- // maybe we were only fetching because of expired TTL, so use the cache regardless of TTL:
- if (typeof event.request.url === 'string') {
- console.info("url: "+event.request.url)
- }
- if (response) {
- return response;
- }
- // if we made it here then we were unable to fetch the resource and do not have it cached.
- console.error(`Error fetching ${event.request.url} resulted in offline`, err);
- return cache.match(this.OFFLINE_PAGE);
- })
- }));
- });
- }
-}
-
-const pwa = new Pwa(self);
-pwa.register();
+class Pwa {
+
+ constructor(self) {
+ this.scope = self;
+ const Version = new URL(location).searchParams.get("v");
+ this.CACHE_VERSION = Version;
+ //this.BASE_CACHE_FILES=['/js/theme.min.js','/js/theme_light.min.js','/abridge.css','/js/abridge.min.js','/','/404.html','/offline/','/manifest.json'];
+ this.BASE_CACHE_FILES = ['/','/404.html','/about/','/abridge.css','/android-chrome-192x192.png','/android-chrome-512x512.png','/apple-touch-icon.png','/archive/','/atom.xml','/banner.png','/blog/','/blog/page/1/','/browserconfig.xml','/contact/','/elasticlunr.min.js','/es/','/es/about/','/es/archive/','/es/atom.xml','/es/blog/','/es/blog/page/1/','/es/contact/','/es/offline/','/es/overview-abridge/','/es/overview-abridge/lighthouse.png','/es/overview-code-blocks/','/es/overview-images/','/es/overview-images/corro.svg','/es/overview-images/ferris-gesture.png','/es/overview-images/ferris-gesture.svg','/es/overview-images/ferris-happy.svg','/es/overview-images/ferris.svg','/es/overview-images/img/ferris-gesture.svg','/es/overview-images/img/ferris.svg','/es/overview-markdown-and-style/','/es/overview-math/','/es/overview-rich-content/','/es/overview-rich-content/over9000-400.avif','/es/overview-rich-content/over9000-640.avif','/es/overview-rich-content/over9000-640.webp','/es/overview-rich-content/over9000-960.avif','/es/overview-rich-content/over9000.mp3','/es/overview-rich-content/over9000.ogg','/es/overview-rich-content/over9000_av1.mp4','/es/overview-rich-content/over9000_vp9.webm','/es/overview-showdata/','/es/page/1/','/es/page/2/','/es/page/3/','/es/page/4/','/es/privacy/','/es/tags/','/es/tags/audio/','/es/tags/audio/atom.xml','/es/tags/config/','/es/tags/config/atom.xml','/es/tags/data/','/es/tags/data/atom.xml','/es/tags/features/','/es/tags/features/atom.xml','/es/tags/images/','/es/tags/images/atom.xml','/es/tags/markdown/','/es/tags/markdown/atom.xml','/es/tags/mathematics/','/es/tags/mathematics/atom.xml','/es/tags/shortcodes/','/es/tags/shortcodes/atom.xml','/es/tags/video/','/es/tags/video/atom.xml','/es/video-streaming-sites/overview-embed-streamable/','/es/video-streaming-sites/overview-embed-vimeo/','/es/video-streaming-sites/overview-embed-youtube/','/favicon-16x16.png','/favicon-32x32.png','/favicon.ico','/favicon.svg','/fonts/KaTeX_AMS-Regular.woff2','/fonts/KaTeX_Caligraphic-Bold.woff2','/fonts/KaTeX_Caligraphic-Regular.woff2','/fonts/KaTeX_Fraktur-Bold.woff2','/fonts/KaTeX_Fraktur-Regular.woff2','/fonts/KaTeX_Main-Bold.woff2','/fonts/KaTeX_Main-BoldItalic.woff2','/fonts/KaTeX_Main-Italic.woff2','/fonts/KaTeX_Main-Regular.woff2','/fonts/KaTeX_Math-BoldItalic.woff2','/fonts/KaTeX_Math-Italic.woff2','/fonts/KaTeX_SansSerif-Bold.woff2','/fonts/KaTeX_SansSerif-Italic.woff2','/fonts/KaTeX_SansSerif-Regular.woff2','/fonts/KaTeX_Script-Regular.woff2','/fonts/KaTeX_Size1-Regular.woff2','/fonts/KaTeX_Size2-Regular.woff2','/fonts/KaTeX_Size3-Regular.woff2','/fonts/KaTeX_Size4-Regular.woff2','/fonts/KaTeX_Typewriter-Regular.woff2','/fonts/Roboto-Bold.woff2','/fonts/Roboto-Italic.woff2','/fonts/Roboto-Mono-Italic.woff2','/fonts/Roboto-Mono.woff2','/fonts/Roboto.woff2','/fr/','/fr/about/','/fr/archive/','/fr/atom.xml','/fr/blog/','/fr/blog/page/1/','/fr/contact/','/fr/offline/','/fr/overview-abridge/','/fr/overview-abridge/lighthouse.png','/fr/overview-code-blocks/','/fr/overview-images/','/fr/overview-images/corro.svg','/fr/overview-images/ferris-gesture.png','/fr/overview-images/ferris-gesture.svg','/fr/overview-images/ferris-happy.svg','/fr/overview-images/ferris.svg','/fr/overview-images/img/ferris-gesture.svg','/fr/overview-images/img/ferris.svg','/fr/overview-markdown-and-style/','/fr/overview-math/','/fr/overview-rich-content/','/fr/overview-rich-content/over9000-400.avif','/fr/overview-rich-content/over9000-640.avif','/fr/overview-rich-content/over9000-640.webp','/fr/overview-rich-content/over9000-960.avif','/fr/overview-rich-content/over9000.mp3','/fr/overview-rich-content/over9000.ogg','/fr/overview-rich-content/over9000_av1.mp4','/fr/overview-rich-content/over9000_vp9.webm','/fr/overview-showdata/','/fr/page/1/','/fr/page/2/','/fr/page/3/','/fr/page/4/','/fr/privacy/','/fr/tags/','/fr/tags/audio/','/fr/tags/audio/atom.xml','/fr/tags/config/','/fr/tags/config/atom.xml','/fr/tags/data/','/fr/tags/data/atom.xml','/fr/tags/features/','/fr/tags/features/atom.xml','/fr/tags/images/','/fr/tags/images/atom.xml','/fr/tags/markdown/','/fr/tags/markdown/atom.xml','/fr/tags/mathematics/','/fr/tags/mathematics/atom.xml','/fr/tags/shortcodes/','/fr/tags/shortcodes/atom.xml','/fr/tags/video/','/fr/tags/video/atom.xml','/fr/video-streaming-sites/overview-embed-streamable/','/fr/video-streaming-sites/overview-embed-vimeo/','/fr/video-streaming-sites/overview-embed-youtube/','/giallo.css','/images/ferris-gesture.svg','/images/ferris.svg','/js/abridge.min.js','/js/abridge_nopwa.min.js','/js/abridge_nosearch.min.js','/js/abridge_nosearch_nopwa.min.js','/js/codecopy.js','/js/elasticlunr.min.js','/js/email.js','/js/katex-auto-render.min.js','/js/katex.min.js','/js/katexbundle.min.js','/js/katexoptions.js','/js/lunr.da.js','/js/lunr.da.min.js','/js/lunr.de.js','/js/lunr.de.min.js','/js/lunr.du.js','/js/lunr.du.min.js','/js/lunr.es.js','/js/lunr.es.min.js','/js/lunr.fi.js','/js/lunr.fi.min.js','/js/lunr.fr.js','/js/lunr.fr.min.js','/js/lunr.hu.js','/js/lunr.hu.min.js','/js/lunr.it.js','/js/lunr.it.min.js','/js/lunr.jp.js','/js/lunr.jp.min.js','/js/lunr.no.js','/js/lunr.no.min.js','/js/lunr.pt.js','/js/lunr.pt.min.js','/js/lunr.ro.js','/js/lunr.ro.min.js','/js/lunr.ru.js','/js/lunr.ru.min.js','/js/lunr.stemmer.support.js','/js/lunr.stemmer.support.min.js','/js/lunr.sv.js','/js/lunr.sv.min.js','/js/lunr.tr.js','/js/lunr.tr.min.js','/js/lunr.zh.js','/js/lunr.zh.min.js','/js/mathtex-script-type.min.js','/js/pagefind.search.js','/js/prestyle.js','/js/search.js','/js/search_elasticlunr.min.js','/js/search_tinysearch.min.js','/js/searchjava.js','/js/searchjavaugly.js','/js/sw_load.js','/js/sw_load.min.js','/js/theme.js','/js/theme.min.js','/js/theme_button.js','/js/theme_light.js','/js/theme_light.min.js','/js/tinysearch.js','/katex.min.css','/m1024.png','/m128.png','/m192.png','/m384.png','/m48.png','/m512.png','/m72.png','/m96.png','/manifest.json','/manifest.min.json','/mstile-150x150.png','/nojs.css','/offline/','/overview-abridge/','/overview-abridge/lighthouse.png','/overview-code-blocks/','/overview-images/','/overview-images/corro.svg','/overview-images/ferris-gesture.png','/overview-images/ferris-gesture.svg','/overview-images/ferris-happy.svg','/overview-images/ferris.svg','/overview-images/img/ferris-gesture.svg','/overview-images/img/ferris.svg','/overview-markdown-and-style/','/overview-math/','/overview-rich-content/','/overview-rich-content/over9000-400.avif','/overview-rich-content/over9000-640.avif','/overview-rich-content/over9000-640.webp','/overview-rich-content/over9000-960.avif','/overview-rich-content/over9000.mp3','/overview-rich-content/over9000.ogg','/overview-rich-content/over9000_av1.mp4','/overview-rich-content/over9000_vp9.webm','/overview-showdata/','/page/1/','/page/2/','/page/3/','/page/4/','/privacy/','/pt/','/pt/about/','/pt/atom.xml','/pt/contact/','/pt/offline/','/pt/page/1/','/pt/privacy/','/robots.txt','/safari-pinned-tab.svg','/search_index.en.json','/search_index.es.json','/search_index.fr.json','/search_index.pt.json','/sitemap.xml','/tags/','/tags/audio/','/tags/audio/atom.xml','/tags/config/','/tags/config/atom.xml','/tags/data/','/tags/data/atom.xml','/tags/features/','/tags/features/atom.xml','/tags/images/','/tags/images/atom.xml','/tags/markdown/','/tags/markdown/atom.xml','/tags/mathematics/','/tags/mathematics/atom.xml','/tags/shortcodes/','/tags/shortcodes/atom.xml','/tags/video/','/tags/video/atom.xml','/tinysearch.toml','/tinysearch_engine.wasm','/video-streaming-sites/overview-embed-streamable/','/video-streaming-sites/overview-embed-vimeo/','/video-streaming-sites/overview-embed-youtube/'];
+ this.host = `${self.location.protocol}//${self.location.host}`;
+ console.info(`Host: ${this.host}`);
+ this.OFFLINE_PAGE = '/offline/';
+ this.NOT_FOUND_PAGE = '/404.html';
+ this.CACHE_NAME = `content-v${this.CACHE_VERSION}`;
+ // 3600=1hour, 28800=8hours, 86400=1day, 604800=1week, 1209600=2weeks
+ this.NORM_TTL = 0;
+ this.LONG_TTL = 0;
+ // keep the ttl on these lower:
+ this.TTL_NORM = ["sw.min.js", "sw_load.min.js"];
+ // rarely change, may be a good idea to periodically refresh, incase I change these and forget to increment service worker version:
+ this.TTL_LONG = ["jpg", "jpeg", "png", "gif", "webp", "avif", "ico", "svg", "xsl", "txt"];
+ // never change, cache forever unless service worker version is incremented:
+ this.TTL_EXEMPT = ["js", "css", "otf", "eot", "ttf", "woff", "woff2", "mp4", "webm", "mp3", "ogg"];
+ // skip these extensions so they expire same time as html: st,wasm,json(search), xml(sitemap,atom,rss)
+ }
+
+ canCache(url) {
+ if (url.startsWith("http://localhost")) {
+ return false;
+ }
+ const result = url.toString().startsWith(this.host);
+ return result;
+ }
+
+ getFileExtension(url) {
+ const extension = url.split('.').reverse()[0].split('?')[0];
+ return (extension.endsWith('/')) ? '/' : extension;
+ }
+ getFileName(url) {
+ const filename = url.substring(url.lastIndexOf('/') + 1).split('?')[0];
+ return (filename.endsWith('/')) ? '/' : filename;
+ }
+
+ getTTL(url) {
+ if (typeof url === 'string') {
+ const extension = this.getFileExtension(url);
+ const filename = this.getFileName(url);
+
+ if (this.TTL_NORM.indexOf(filename) > -1) {
+ console.info(url + ' contains a TTL_NORM filename');
+ return this.NORM_TTL;
+ }
+ if (this.TTL_LONG.indexOf(extension) > -1) {
+ console.info(url + ' contains a TTL_LONG extension');
+ return this.LONG_TTL;
+ }
+ if (this.TTL_EXEMPT.indexOf(extension) > -1) {
+ console.info(url + ' contains a TTL_EXEMPT extension');
+ return null;
+ }
+ console.info(url + ' TTL_NORM');
+ return this.NORM_TTL;
+ }
+ return null;
+ }
+
+ async installServiceWorker() {
+ try {
+ await caches.open(this.CACHE_NAME).then((cache) => {
+ return cache.addAll(this.BASE_CACHE_FILES);
+ }, err => console.error(`Error with ${this.CACHE_NAME}`, err));
+ return this.scope.skipWaiting();
+ }
+ catch (err) {
+ return console.error("Error with installation: ", err);
+ }
+ }
+
+ cleanupLegacyCache() {
+
+ const currentCaches = [this.CACHE_NAME];
+
+ return new Promise(
+ (resolve, reject) => {
+ caches.keys()
+ .then((keys) => keys.filter((key) => !~currentCaches.indexOf(key)))
+ .then((legacy) => {
+ if (legacy.length) {
+ Promise.all(legacy.map((legacyKey) => caches.delete(legacyKey))
+ ).then(() => resolve()).catch((err) => {
+ console.error("Error in legacy cleanup: ", err);
+ reject(err);
+ });
+ } else {
+ resolve();
+ }
+ }).catch((err) => {
+ console.error("Error in legacy cleanup: ", err);
+ reject(err);
+ });
+ });
+ }
+
+ async preCacheUrl(url) {
+ const cache = await caches.open(this.CACHE_NAME);
+ const response = await cache.match(url);
+ if (!response) {
+ return fetch(url).then(resp => cache.put(url, resp.clone()));
+ }
+ return null;
+ }
+
+ register() {
+ this.scope.addEventListener('install', event => {
+ event.waitUntil(
+ Promise.all([
+ this.installServiceWorker(),
+ this.scope.skipWaiting(),
+ ]));
+ console.info('SW Installed');
+ });
+
+ this.scope.addEventListener('activate', event => {
+ event.waitUntil(Promise.all(
+ [this.cleanupLegacyCache(),
+ this.scope.clients.claim(),
+ this.scope.skipWaiting()]).catch((err) => {
+ console.error("Activation error: ", err);
+ event.skipWaiting();
+ }));
+ });
+
+ this.scope.addEventListener('fetch', event => {
+ event.respondWith(
+ caches.open(this.CACHE_NAME).then(async cache => {
+ // check if this is NOT a resource we allow cacheing (some other domain), if so fetch it instead of cache.
+ if (!this.canCache(event.request.url)) {
+ return fetch(event.request);
+ }
+ // check the cache for the requested resource
+ const response = await cache.match(event.request);
+ if (response) {
+ const headers = response.headers.entries();
+ let date = null;
+ for (let pair of headers) {
+ if (pair[0] === 'date') {
+ date = new Date(pair[1]);
+ break;
+ }
+ }
+ // date is not working, so ignore TTL and just serve the cached resource.
+ if (!date) {
+ return response;
+ }
+ const age = parseInt(((new Date().getTime() - date.getTime()) / 1000).toString());
+ const ttl = this.getTTL(event.request.url);
+ if (ttl === null || (ttl && age < ttl)) {
+ // return the resource if it is not beyond the TTL
+ return response;
+ }
+ }
+ // if we made it here then we either did not have the cache, or the TTL was expired.
+ return fetch(event.request.clone()).then(resp => {
+ if (resp.status < 400) {
+ if (this.canCache(event.request.url)) {
+ cache.put(event.request, resp.clone());
+ }
+ return resp;
+ }
+ else {
+ return cache.match(this.NOT_FOUND_PAGE);
+ }
+ }).catch(err => {
+ // if we made it here then we were unable to fetch the resource.
+ // maybe we were only fetching because of expired TTL, so use the cache regardless of TTL:
+ if (typeof event.request.url === 'string') {
+ console.info("url: "+event.request.url)
+ }
+ if (response) {
+ return response;
+ }
+ // if we made it here then we were unable to fetch the resource and do not have it cached.
+ console.error(`Error fetching ${event.request.url} resulted in offline`, err);
+ return cache.match(this.OFFLINE_PAGE);
+ })
+ }));
+ });
+ }
+}
+
+const pwa = new Pwa(self);
+pwa.register();
diff --git a/static/sw.min.js b/static/sw.min.js
index 16b26b9..a0bb209 100644
--- a/static/sw.min.js
+++ b/static/sw.min.js
@@ -1 +1 @@
-class Pwa{constructor(e){this.scope=e;var s=new URL(location).searchParams.get("v");this.CACHE_VERSION=s,this.BASE_CACHE_FILES=["/","/404.html","/about/","/abridge.css","/android-chrome-192x192.png","/android-chrome-512x512.png","/apple-touch-icon.png","/archive/","/atom.xml","/banner.png","/blog/","/blog/page/1/","/browserconfig.xml","/contact/","/elasticlunr.min.js","/es/","/es/about/","/es/archive/","/es/atom.xml","/es/blog/","/es/blog/page/1/","/es/contact/","/es/page/1/","/es/privacy/","/es/tags/","/es/tags/features/","/es/tags/features/atom.xml","/es/tags/shortcodes/","/es/tags/shortcodes/atom.xml","/es/tags/video/","/es/tags/video/atom.xml","/es/video-streaming-sites/overview-embed-streamable/","/favicon-16x16.png","/favicon-32x32.png","/favicon.ico","/favicon.svg","/fonts/KaTeX_AMS-Regular.woff2","/fonts/KaTeX_Caligraphic-Bold.woff2","/fonts/KaTeX_Caligraphic-Regular.woff2","/fonts/KaTeX_Fraktur-Bold.woff2","/fonts/KaTeX_Fraktur-Regular.woff2","/fonts/KaTeX_Main-Bold.woff2","/fonts/KaTeX_Main-BoldItalic.woff2","/fonts/KaTeX_Main-Italic.woff2","/fonts/KaTeX_Main-Regular.woff2","/fonts/KaTeX_Math-BoldItalic.woff2","/fonts/KaTeX_Math-Italic.woff2","/fonts/KaTeX_SansSerif-Bold.woff2","/fonts/KaTeX_SansSerif-Italic.woff2","/fonts/KaTeX_SansSerif-Regular.woff2","/fonts/KaTeX_Script-Regular.woff2","/fonts/KaTeX_Size1-Regular.woff2","/fonts/KaTeX_Size2-Regular.woff2","/fonts/KaTeX_Size3-Regular.woff2","/fonts/KaTeX_Size4-Regular.woff2","/fonts/KaTeX_Typewriter-Regular.woff2","/fonts/Roboto-Bold.woff2","/fonts/Roboto-Italic.woff2","/fonts/Roboto-Mono-Italic.woff2","/fonts/Roboto-Mono.woff2","/fonts/Roboto.woff2","/fr/","/fr/about/","/fr/archive/","/fr/atom.xml","/fr/blog/","/fr/blog/page/1/","/fr/contact/","/fr/offline/","/fr/overview-code-blocks/","/fr/overview-images/","/fr/overview-images/corro.svg","/fr/overview-images/ferris-gesture.png","/fr/overview-images/ferris-gesture.svg","/fr/overview-images/ferris-happy.svg","/fr/overview-images/ferris.svg","/fr/overview-images/img/ferris-gesture.svg","/fr/overview-images/img/ferris.svg","/fr/overview-markdown-and-style/","/fr/overview-math/","/fr/overview-rich-content/","/fr/overview-rich-content/over9000-400.avif","/fr/overview-rich-content/over9000-640.avif","/fr/overview-rich-content/over9000-640.webp","/fr/overview-rich-content/over9000-960.avif","/fr/overview-rich-content/over9000.mp3","/fr/overview-rich-content/over9000.ogg","/fr/overview-rich-content/over9000_av1.mp4","/fr/overview-rich-content/over9000_vp9.webm","/fr/overview-showdata/","/fr/page/1/","/fr/page/2/","/fr/page/3/","/fr/privacy/","/fr/tags/","/fr/tags/audio/","/fr/tags/audio/atom.xml","/fr/tags/data/","/fr/tags/data/atom.xml","/fr/tags/features/","/fr/tags/features/atom.xml","/fr/tags/images/","/fr/tags/images/atom.xml","/fr/tags/markdown/","/fr/tags/markdown/atom.xml","/fr/tags/mathematics/","/fr/tags/mathematics/atom.xml","/fr/tags/shortcodes/","/fr/tags/shortcodes/atom.xml","/fr/tags/video/","/fr/tags/video/atom.xml","/fr/video-streaming-sites/overview-embed-streamable/","/fr/video-streaming-sites/overview-embed-vimeo/","/fr/video-streaming-sites/overview-embed-youtube/","/images/ferris-gesture.svg","/images/ferris.svg","/js/abridge.min.js","/js/abridge_nopwa.min.js","/js/abridge_nosearch.min.js","/js/abridge_nosearch_nopwa.min.js","/js/codecopy.js","/js/elasticlunr.min.js","/js/email.js","/js/katex-auto-render.min.js","/js/katex.min.js","/js/katexbundle.min.js","/js/katexoptions.js","/js/lunr.da.js","/js/lunr.da.min.js","/js/lunr.de.js","/js/lunr.de.min.js","/js/lunr.du.js","/js/lunr.du.min.js","/js/lunr.es.js","/js/lunr.es.min.js","/js/lunr.fi.js","/js/lunr.fi.min.js","/js/lunr.fr.js","/js/lunr.fr.min.js","/js/lunr.hu.js","/js/lunr.hu.min.js","/js/lunr.it.js","/js/lunr.it.min.js","/js/lunr.jp.js","/js/lunr.jp.min.js","/js/lunr.no.js","/js/lunr.no.min.js","/js/lunr.pt.js","/js/lunr.pt.min.js","/js/lunr.ro.js","/js/lunr.ro.min.js","/js/lunr.ru.js","/js/lunr.ru.min.js","/js/lunr.stemmer.support.js","/js/lunr.stemmer.support.min.js","/js/lunr.sv.js","/js/lunr.sv.min.js","/js/lunr.tr.js","/js/lunr.tr.min.js","/js/lunr.zh.js","/js/lunr.zh.min.js","/js/mathtex-script-type.min.js","/js/pagefind.search.js","/js/prestyle.js","/js/search.js","/js/search_elasticlunr.min.js","/js/search_tinysearch.min.js","/js/searchjava.js","/js/searchjavaugly.js","/js/sw_load.js","/js/sw_load.min.js","/js/theme.js","/js/theme.min.js","/js/theme_button.js","/js/theme_light.js","/js/theme_light.min.js","/js/tinysearch.js","/katex.min.css","/m1024.png","/m128.png","/m192.png","/m384.png","/m48.png","/m512.png","/m72.png","/m96.png","/manifest.json","/manifest.min.json","/mstile-150x150.png","/nojs.css","/offline/","/overview-abridge/","/overview-abridge/lighthouse.png","/overview-code-blocks/","/overview-images/","/overview-images/corro.svg","/overview-images/ferris-gesture.png","/overview-images/ferris-gesture.svg","/overview-images/ferris-happy.svg","/overview-images/ferris.svg","/overview-images/img/ferris-gesture.svg","/overview-images/img/ferris.svg","/overview-markdown-and-style/","/overview-math/","/overview-rich-content/","/overview-rich-content/over9000-400.avif","/overview-rich-content/over9000-640.avif","/overview-rich-content/over9000-640.webp","/overview-rich-content/over9000-960.avif","/overview-rich-content/over9000.mp3","/overview-rich-content/over9000.ogg","/overview-rich-content/over9000_av1.mp4","/overview-rich-content/over9000_vp9.webm","/overview-showdata/","/page/1/","/page/2/","/page/3/","/page/4/","/privacy/","/pt/","/pt/about/","/pt/contact/","/pt/page/1/","/pt/privacy/","/robots.txt","/safari-pinned-tab.svg","/search_index.en.json","/search_index.es.json","/search_index.fr.json","/search_index.pt.json","/sitemap.xml","/tags/","/tags/audio/","/tags/audio/atom.xml","/tags/config/","/tags/config/atom.xml","/tags/data/","/tags/data/atom.xml","/tags/features/","/tags/features/atom.xml","/tags/images/","/tags/images/atom.xml","/tags/markdown/","/tags/markdown/atom.xml","/tags/mathematics/","/tags/mathematics/atom.xml","/tags/shortcodes/","/tags/shortcodes/atom.xml","/tags/video/","/tags/video/atom.xml","/tinysearch_engine_bg.wasm","/video-streaming-sites/overview-embed-streamable/","/video-streaming-sites/overview-embed-vimeo/","/video-streaming-sites/overview-embed-youtube/"],this.host=e.location.protocol+"//"+e.location.host,this.OFFLINE_PAGE="/offline/",this.NOT_FOUND_PAGE="/404.html",this.CACHE_NAME="content-v"+this.CACHE_VERSION,this.NORM_TTL=0,this.LONG_TTL=0,this.TTL_NORM=["sw.min.js","sw_load.min.js"],this.TTL_LONG=["jpg","jpeg","png","gif","webp","avif","ico","svg","xsl","txt"],this.TTL_EXEMPT=["js","css","otf","eot","ttf","woff","woff2","mp4","webm","mp3","ogg"]}canCache(e){return!e.startsWith("http://localhost")&&e.toString().startsWith(this.host)}getFileExtension(e){e=e.split(".").reverse()[0].split("?")[0];return e.endsWith("/")?"/":e}getFileName(e){e=e.substring(1+e.lastIndexOf("/")).split("?")[0];return e.endsWith("/")?"/":e}getTTL(e){var s;return"string"==typeof e?(s=this.getFileExtension(e),e=this.getFileName(e),~this.TTL_NORM.indexOf(e)?this.NORM_TTL:~this.TTL_LONG.indexOf(s)?this.LONG_TTL:~this.TTL_EXEMPT.indexOf(s)?null:this.NORM_TTL):null}async installServiceWorker(){try{return await caches.open(this.CACHE_NAME).then(e=>e.addAll(this.BASE_CACHE_FILES),e=>{}),this.scope.skipWaiting()}catch(e){}}cleanupLegacyCache(){let r=[this.CACHE_NAME];return new Promise((s,t)=>{caches.keys().then(e=>e.filter(e=>!~r.indexOf(e))).then(e=>{e.length?Promise.all(e.map(e=>caches.delete(e))).then(()=>s()).catch(e=>{t(e)}):s()}).catch(e=>{t(e)})})}async preCacheUrl(s){let t=await caches.open(this.CACHE_NAME);return await t.match(s)?null:fetch(s).then(e=>t.put(s,e.clone()))}register(){this.scope.addEventListener("install",e=>{e.waitUntil(Promise.all([this.installServiceWorker(),this.scope.skipWaiting()]))}),this.scope.addEventListener("activate",s=>{s.waitUntil(Promise.all([this.cleanupLegacyCache(),this.scope.clients.claim(),this.scope.skipWaiting()]).catch(e=>{s.skipWaiting()}))}),this.scope.addEventListener("fetch",o=>{o.respondWith(caches.open(this.CACHE_NAME).then(async s=>{if(!this.canCache(o.request.url))return fetch(o.request);let t=await s.match(o.request);if(t){var r;let e=null;for(r of t.headers.entries())if("date"===r[0]){e=new Date(r[1]);break}if(!e)return t;var i=parseInt(""+((new Date).getTime()-e.getTime())/1e3),a=this.getTTL(o.request.url);if(null===a||a&&i<a)return t}return fetch(o.request.clone()).then(e=>e.status<400?(this.canCache(o.request.url)&&s.put(o.request,e.clone()),e):s.match(this.NOT_FOUND_PAGE)).catch(e=>(o.request.url,t||s.match(this.OFFLINE_PAGE)))}))})}}let pwa=new Pwa(self);pwa.register(); \ No newline at end of file
+class Pwa{constructor(e){this.scope=e;var s=new URL(location).searchParams.get("v");this.CACHE_VERSION=s,this.BASE_CACHE_FILES=["/","/404.html","/about/","/abridge.css","/android-chrome-192x192.png","/android-chrome-512x512.png","/apple-touch-icon.png","/archive/","/atom.xml","/banner.png","/blog/","/blog/page/1/","/browserconfig.xml","/contact/","/elasticlunr.min.js","/es/","/es/about/","/es/archive/","/es/atom.xml","/es/blog/","/es/blog/page/1/","/es/contact/","/es/offline/","/es/overview-abridge/","/es/overview-abridge/lighthouse.png","/es/overview-code-blocks/","/es/overview-images/","/es/overview-images/corro.svg","/es/overview-images/ferris-gesture.png","/es/overview-images/ferris-gesture.svg","/es/overview-images/ferris-happy.svg","/es/overview-images/ferris.svg","/es/overview-images/img/ferris-gesture.svg","/es/overview-images/img/ferris.svg","/es/overview-markdown-and-style/","/es/overview-math/","/es/overview-rich-content/","/es/overview-rich-content/over9000-400.avif","/es/overview-rich-content/over9000-640.avif","/es/overview-rich-content/over9000-640.webp","/es/overview-rich-content/over9000-960.avif","/es/overview-rich-content/over9000.mp3","/es/overview-rich-content/over9000.ogg","/es/overview-rich-content/over9000_av1.mp4","/es/overview-rich-content/over9000_vp9.webm","/es/overview-showdata/","/es/page/1/","/es/page/2/","/es/page/3/","/es/page/4/","/es/privacy/","/es/tags/","/es/tags/audio/","/es/tags/audio/atom.xml","/es/tags/config/","/es/tags/config/atom.xml","/es/tags/data/","/es/tags/data/atom.xml","/es/tags/features/","/es/tags/features/atom.xml","/es/tags/images/","/es/tags/images/atom.xml","/es/tags/markdown/","/es/tags/markdown/atom.xml","/es/tags/mathematics/","/es/tags/mathematics/atom.xml","/es/tags/shortcodes/","/es/tags/shortcodes/atom.xml","/es/tags/video/","/es/tags/video/atom.xml","/es/video-streaming-sites/overview-embed-streamable/","/es/video-streaming-sites/overview-embed-vimeo/","/es/video-streaming-sites/overview-embed-youtube/","/favicon-16x16.png","/favicon-32x32.png","/favicon.ico","/favicon.svg","/fonts/KaTeX_AMS-Regular.woff2","/fonts/KaTeX_Caligraphic-Bold.woff2","/fonts/KaTeX_Caligraphic-Regular.woff2","/fonts/KaTeX_Fraktur-Bold.woff2","/fonts/KaTeX_Fraktur-Regular.woff2","/fonts/KaTeX_Main-Bold.woff2","/fonts/KaTeX_Main-BoldItalic.woff2","/fonts/KaTeX_Main-Italic.woff2","/fonts/KaTeX_Main-Regular.woff2","/fonts/KaTeX_Math-BoldItalic.woff2","/fonts/KaTeX_Math-Italic.woff2","/fonts/KaTeX_SansSerif-Bold.woff2","/fonts/KaTeX_SansSerif-Italic.woff2","/fonts/KaTeX_SansSerif-Regular.woff2","/fonts/KaTeX_Script-Regular.woff2","/fonts/KaTeX_Size1-Regular.woff2","/fonts/KaTeX_Size2-Regular.woff2","/fonts/KaTeX_Size3-Regular.woff2","/fonts/KaTeX_Size4-Regular.woff2","/fonts/KaTeX_Typewriter-Regular.woff2","/fonts/Roboto-Bold.woff2","/fonts/Roboto-Italic.woff2","/fonts/Roboto-Mono-Italic.woff2","/fonts/Roboto-Mono.woff2","/fonts/Roboto.woff2","/fr/","/fr/about/","/fr/archive/","/fr/atom.xml","/fr/blog/","/fr/blog/page/1/","/fr/contact/","/fr/offline/","/fr/overview-abridge/","/fr/overview-abridge/lighthouse.png","/fr/overview-code-blocks/","/fr/overview-images/","/fr/overview-images/corro.svg","/fr/overview-images/ferris-gesture.png","/fr/overview-images/ferris-gesture.svg","/fr/overview-images/ferris-happy.svg","/fr/overview-images/ferris.svg","/fr/overview-images/img/ferris-gesture.svg","/fr/overview-images/img/ferris.svg","/fr/overview-markdown-and-style/","/fr/overview-math/","/fr/overview-rich-content/","/fr/overview-rich-content/over9000-400.avif","/fr/overview-rich-content/over9000-640.avif","/fr/overview-rich-content/over9000-640.webp","/fr/overview-rich-content/over9000-960.avif","/fr/overview-rich-content/over9000.mp3","/fr/overview-rich-content/over9000.ogg","/fr/overview-rich-content/over9000_av1.mp4","/fr/overview-rich-content/over9000_vp9.webm","/fr/overview-showdata/","/fr/page/1/","/fr/page/2/","/fr/page/3/","/fr/page/4/","/fr/privacy/","/fr/tags/","/fr/tags/audio/","/fr/tags/audio/atom.xml","/fr/tags/config/","/fr/tags/config/atom.xml","/fr/tags/data/","/fr/tags/data/atom.xml","/fr/tags/features/","/fr/tags/features/atom.xml","/fr/tags/images/","/fr/tags/images/atom.xml","/fr/tags/markdown/","/fr/tags/markdown/atom.xml","/fr/tags/mathematics/","/fr/tags/mathematics/atom.xml","/fr/tags/shortcodes/","/fr/tags/shortcodes/atom.xml","/fr/tags/video/","/fr/tags/video/atom.xml","/fr/video-streaming-sites/overview-embed-streamable/","/fr/video-streaming-sites/overview-embed-vimeo/","/fr/video-streaming-sites/overview-embed-youtube/","/giallo.css","/images/ferris-gesture.svg","/images/ferris.svg","/js/abridge.min.js","/js/abridge_nopwa.min.js","/js/abridge_nosearch.min.js","/js/abridge_nosearch_nopwa.min.js","/js/codecopy.js","/js/elasticlunr.min.js","/js/email.js","/js/katex-auto-render.min.js","/js/katex.min.js","/js/katexbundle.min.js","/js/katexoptions.js","/js/lunr.da.js","/js/lunr.da.min.js","/js/lunr.de.js","/js/lunr.de.min.js","/js/lunr.du.js","/js/lunr.du.min.js","/js/lunr.es.js","/js/lunr.es.min.js","/js/lunr.fi.js","/js/lunr.fi.min.js","/js/lunr.fr.js","/js/lunr.fr.min.js","/js/lunr.hu.js","/js/lunr.hu.min.js","/js/lunr.it.js","/js/lunr.it.min.js","/js/lunr.jp.js","/js/lunr.jp.min.js","/js/lunr.no.js","/js/lunr.no.min.js","/js/lunr.pt.js","/js/lunr.pt.min.js","/js/lunr.ro.js","/js/lunr.ro.min.js","/js/lunr.ru.js","/js/lunr.ru.min.js","/js/lunr.stemmer.support.js","/js/lunr.stemmer.support.min.js","/js/lunr.sv.js","/js/lunr.sv.min.js","/js/lunr.tr.js","/js/lunr.tr.min.js","/js/lunr.zh.js","/js/lunr.zh.min.js","/js/mathtex-script-type.min.js","/js/pagefind.search.js","/js/prestyle.js","/js/search.js","/js/search_elasticlunr.min.js","/js/search_tinysearch.min.js","/js/searchjava.js","/js/searchjavaugly.js","/js/sw_load.js","/js/sw_load.min.js","/js/theme.js","/js/theme.min.js","/js/theme_button.js","/js/theme_light.js","/js/theme_light.min.js","/js/tinysearch.js","/katex.min.css","/m1024.png","/m128.png","/m192.png","/m384.png","/m48.png","/m512.png","/m72.png","/m96.png","/manifest.json","/manifest.min.json","/mstile-150x150.png","/nojs.css","/offline/","/overview-abridge/","/overview-abridge/lighthouse.png","/overview-code-blocks/","/overview-images/","/overview-images/corro.svg","/overview-images/ferris-gesture.png","/overview-images/ferris-gesture.svg","/overview-images/ferris-happy.svg","/overview-images/ferris.svg","/overview-images/img/ferris-gesture.svg","/overview-images/img/ferris.svg","/overview-markdown-and-style/","/overview-math/","/overview-rich-content/","/overview-rich-content/over9000-400.avif","/overview-rich-content/over9000-640.avif","/overview-rich-content/over9000-640.webp","/overview-rich-content/over9000-960.avif","/overview-rich-content/over9000.mp3","/overview-rich-content/over9000.ogg","/overview-rich-content/over9000_av1.mp4","/overview-rich-content/over9000_vp9.webm","/overview-showdata/","/page/1/","/page/2/","/page/3/","/page/4/","/privacy/","/pt/","/pt/about/","/pt/atom.xml","/pt/contact/","/pt/offline/","/pt/page/1/","/pt/privacy/","/robots.txt","/safari-pinned-tab.svg","/search_index.en.json","/search_index.es.json","/search_index.fr.json","/search_index.pt.json","/sitemap.xml","/tags/","/tags/audio/","/tags/audio/atom.xml","/tags/config/","/tags/config/atom.xml","/tags/data/","/tags/data/atom.xml","/tags/features/","/tags/features/atom.xml","/tags/images/","/tags/images/atom.xml","/tags/markdown/","/tags/markdown/atom.xml","/tags/mathematics/","/tags/mathematics/atom.xml","/tags/shortcodes/","/tags/shortcodes/atom.xml","/tags/video/","/tags/video/atom.xml","/tinysearch.toml","/tinysearch_engine.wasm","/video-streaming-sites/overview-embed-streamable/","/video-streaming-sites/overview-embed-vimeo/","/video-streaming-sites/overview-embed-youtube/"],this.host=e.location.protocol+"//"+e.location.host,this.OFFLINE_PAGE="/offline/",this.NOT_FOUND_PAGE="/404.html",this.CACHE_NAME="content-v"+this.CACHE_VERSION,this.NORM_TTL=0,this.LONG_TTL=0,this.TTL_NORM=["sw.min.js","sw_load.min.js"],this.TTL_LONG=["jpg","jpeg","png","gif","webp","avif","ico","svg","xsl","txt"],this.TTL_EXEMPT=["js","css","otf","eot","ttf","woff","woff2","mp4","webm","mp3","ogg"]}canCache(e){return!e.startsWith("http://localhost")&&e.toString().startsWith(this.host)}getFileExtension(e){e=e.split(".").reverse()[0].split("?")[0];return e.endsWith("/")?"/":e}getFileName(e){e=e.substring(1+e.lastIndexOf("/")).split("?")[0];return e.endsWith("/")?"/":e}getTTL(e){var s;return"string"==typeof e?(s=this.getFileExtension(e),e=this.getFileName(e),~this.TTL_NORM.indexOf(e)?this.NORM_TTL:~this.TTL_LONG.indexOf(s)?this.LONG_TTL:~this.TTL_EXEMPT.indexOf(s)?null:this.NORM_TTL):null}async installServiceWorker(){try{return await caches.open(this.CACHE_NAME).then(e=>e.addAll(this.BASE_CACHE_FILES),e=>{}),this.scope.skipWaiting()}catch(e){}}cleanupLegacyCache(){let r=[this.CACHE_NAME];return new Promise((s,t)=>{caches.keys().then(e=>e.filter(e=>!~r.indexOf(e))).then(e=>{e.length?Promise.all(e.map(e=>caches.delete(e))).then(()=>s()).catch(e=>{t(e)}):s()}).catch(e=>{t(e)})})}async preCacheUrl(s){let t=await caches.open(this.CACHE_NAME);return await t.match(s)?null:fetch(s).then(e=>t.put(s,e.clone()))}register(){this.scope.addEventListener("install",e=>{e.waitUntil(Promise.all([this.installServiceWorker(),this.scope.skipWaiting()]))}),this.scope.addEventListener("activate",s=>{s.waitUntil(Promise.all([this.cleanupLegacyCache(),this.scope.clients.claim(),this.scope.skipWaiting()]).catch(e=>{s.skipWaiting()}))}),this.scope.addEventListener("fetch",o=>{o.respondWith(caches.open(this.CACHE_NAME).then(async s=>{if(!this.canCache(o.request.url))return fetch(o.request);let t=await s.match(o.request);if(t){var r;let e=null;for(r of t.headers.entries())if("date"===r[0]){e=new Date(r[1]);break}if(!e)return t;var i=parseInt(""+((new Date).getTime()-e.getTime())/1e3),a=this.getTTL(o.request.url);if(null===a||a&&i<a)return t}return fetch(o.request.clone()).then(e=>e.status<400?(this.canCache(o.request.url)&&s.put(o.request,e.clone()),e):s.match(this.NOT_FOUND_PAGE)).catch(e=>(o.request.url,t||s.match(this.OFFLINE_PAGE)))}))})}}let pwa=new Pwa(self);pwa.register(); \ No newline at end of file
diff --git a/static/tinysearch.toml b/static/tinysearch.toml
new file mode 100644
index 0000000..2a3196b
--- /dev/null
+++ b/static/tinysearch.toml
@@ -0,0 +1,4 @@
+[schema]
+indexed_fields = ["title", "body"]
+metadata_fields = ["description"]
+url_field = "url"
diff --git a/static/tinysearch_engine.wasm b/static/tinysearch_engine.wasm
new file mode 100755
index 0000000..7dd234e
--- /dev/null
+++ b/static/tinysearch_engine.wasm
Binary files differ
diff --git a/static/tinysearch_engine_bg.wasm b/static/tinysearch_engine_bg.wasm
deleted file mode 100644
index 6524c13..0000000
--- a/static/tinysearch_engine_bg.wasm
+++ /dev/null
Binary files differ
diff --git a/templates/404.html b/templates/404.html
index 8c42866..70e1f91 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -2,20 +2,17 @@
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-{%- block seo %}
+{%- block seo -%}
{{ super() }}
- {%- set title = "404 Page not found" %}
-
- {%- if config.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_404=true) }}
-{%- endblock seo %}
+ {%- set title = "404 Page not found" -%}
+ {%- if config.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} is_404={true} />}}
+{%- endblock seo -%}
{%- block content %}
<div>
@@ -29,11 +26,11 @@
{%- set i18n_404 = load_data(path="i18n/" ~ lcode ~ '.toml', required=false) -%}
{%- if not i18n_404 -%}{%- set i18n_404 = load_data(path="themes/abridge/i18n/" ~ lcode ~ ".toml", required=false) -%}{%- endif %}
- <p>{{ macros::translate(key="404_not_found", default="404_not_found", i18n=i18n_404) }}{{ macros::translate(key="full_stop", default=".", i18n=i18n_404) }} {% if config.build_search_index %}{{ macros::translate(key="404_try_search", default="Try searching or", i18n=i18n_404) }}{% endif %} <a href="{{ config.base_url }}/{{ lcode }}/{%- if uglyurls %}index.html{%- endif %}">{{ macros::translate(key="404_go_home", default="go to homepage", i18n=i18n_404) }}</a>{{ macros::translate(key="full_stop", default=".", i18n=i18n_404) }}</p>
+ <p>{{<translate key="404_not_found" default="404_not_found" i18n={i18n_404} />}}{{<translate key="full_stop" default="." i18n={i18n_404} />}} {% if config.build_search_index %}{{<translate key="404_try_search" default="Try searching or" i18n={i18n_404} />}}{% endif %} <a href="{{ config.base_url }}/{{ lcode }}/{%- if uglyurls %}index.html{%- endif %}">{{<translate key="404_go_home" default="go to homepage" i18n={i18n_404} />}}</a>{{<translate key="full_stop" default="." i18n={i18n_404} />}}</p>
{%- endif -%}
{%- endfor -%}
{% if config.default_language != "en" %}
- <p>{{ macros::translate(key="404_not_found", default="404_not_found", i18n=i18n) }}{{ macros::translate(key="full_stop", default=".", i18n=i18n) }} {% if config.build_search_index %}{{ macros::translate(key="404_try_search", default="Try searching or", i18n=i18n) }}{% endif %} <a href="{{ config.base_url }}/{%- if uglyurls %}index.html{%- endif %}">{{ macros::translate(key="404_go_home", default="go to homepage", i18n=i18n) }}</a>{{ macros::translate(key="full_stop", default=".", i18n=i18n) }}</p>
+ <p>{{<translate key="404_not_found" default="404_not_found" i18n={i18n} />}}{{<translate key="full_stop" default="." i18n={i18n} />}} {% if config.build_search_index %}{{<translate key="404_try_search" default="Try searching or" i18n={i18n} />}}{% endif %} <a href="{{ config.base_url }}/{%- if uglyurls %}index.html{%- endif %}">{{<translate key="404_go_home" default="go to homepage" i18n={i18n} />}}</a>{{<translate key="full_stop" default="." i18n={i18n} />}}</p>
{% endif %}
</div>
{%- endblock content %}
diff --git a/templates/archive.html b/templates/archive.html
index aac705a..8bc0f27 100644
--- a/templates/archive.html
+++ b/templates/archive.html
@@ -7,24 +7,21 @@ This Template can also be used as the rendering template for Sections, eg: examp
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-{%- block seo %}
- {{- super() }}
- {%- set title = "Archive" %}
-
- {%- if config.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title = "Archive" -%}
+ {%- if config.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} is_home={true} />}}
+{%- endblock seo -%}
{%- block content %}
{#- The following line is checking if the template is being used for the archive page or a section #}
- {%- if current_path is matching("^(/[[:alpha:]][[:alpha:]])?/archive/$") %}
+ {%- if current_path is matching(pat="^(/[[:alpha:]][[:alpha:]])?/archive/$") %}
{%- if section.extra.sec %}
{%- set sec = section.extra.sec ~ "/" %}
{%- else %}
@@ -36,7 +33,7 @@ This Template can also be used as the rendering template for Sections, eg: examp
{%- set langpath = "/" ~ lang ~ "/" %}
{%- endif %}
- {%- set sec = current_path | trim_start_matches(pat=langpath) | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %}
+ {%- set sec = current_path | trim_start(pat=langpath) | split(pat="/page/") | first | trim_end(pat="/") %}
{%- set sec = sec ~ "/" %}
{%- endif %}
diff --git a/templates/base.html b/templates/base.html
index d16854c..97d2f4d 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,29 +1,22 @@
-{%- import 'macros/seo.html' as macros_seo %}
-{%- import "macros/macros.html" as macros %}
-{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #}
+{#- Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. -#}
{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
-{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %}
-
+{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif -%}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
+{%- if config.extra.search_library -%}{%- if config.extra.search_library == "offline" -%}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
<!DOCTYPE html>
<html lang="{%- if lang != config.default_language %}{{ lang }}{% else %}{{ config.extra.language_code | default(value=lang) }}{% endif %}">
<head>
- {%- include "partials/head.html" %}
-
- {#- SEO: title, description, etc #}
- {%- block seo %}
- {%- if config.extra.title_separator %}
+ {%- include "partials/head.html" -%}
+ {#- SEO: title, description, etc -#}
+ {%- block seo -%}
+ {%- if config.extra.title_separator -%}
{%- set title_separator = " " ~ config.extra.title_separator ~ " " -%}
- {%- else %}
+ {%- else -%}
{%- set title_separator = " | " -%}
- {%- endif %}
- {%- endblock seo %}
-
- {%- block comments_init %}
- {%- endblock comments_init %}
-
- {%- include "partials/head_js.html" %}
+ {%- endif -%}
+ {%- endblock seo -%}
+ {%- block comments_init -%}{%- endblock comments_init -%}
+ {%- include "partials/head_js.html" -%}
</head>
<body>
{%- block header %}
@@ -33,10 +26,10 @@
{%- if config.extra.logo -%}
<big><a href="{{ get_url(path="/", lang=lang) }}{%- if uglyurls %}/index.html{%- endif %}" title="{{config.title}}">
- {%- if config.extra.logo.file -%}
- <img src="{{ config.base_url | safe }}/{{ config.extra.logo.file | safe }}"{%- if config.extra.logo.alt %} alt="{{ config.extra.logo.alt | safe }}"{%- else %} alt=""{%- endif %}{%- if config.extra.logo.width %} width="{{ config.extra.logo.width | safe }}"{%- endif %}{%- if config.extra.logo.height %} height="{{ config.extra.logo.height | safe }}"{%- endif %} />
+ {%- if config.extra.logo?.file -%}
+ <img src="{{ config.base_url | safe }}/{{ config.extra.logo?.file | safe }}"{%- if config.extra.logo?.alt %} alt="{{ config.extra.logo?.alt | safe }}"{%- else %} alt=""{%- endif %}{%- if config.extra.logo?.width %} width="{{ config.extra.logo?.width | safe }}"{%- endif %}{%- if config.extra.logo?.height %} height="{{ config.extra.logo?.height | safe }}"{%- endif %} />
{%- endif -%}
- {%- if config.extra.logo.text -%}{{ config.extra.logo.text | safe }}{%- endif -%}
+ {%- if config.extra.logo?.text -%}{{ config.extra.logo?.text | safe }}{%- endif -%}
</a></big>
{%- elif config.extra.textlogo -%}
@@ -55,8 +48,8 @@
{%- set js_switcher=config.extra.js_switcher | default(value=true) %}
{%- if config.extra.menu %}
{%- for i in config.extra.menu -%}
- <li><a{%- if i.size %} class="{{ i.size }}"{% endif %} href="{%- if i.url is matching("^http[s]?://") %}{{ i.url }}{%- else -%}{{ get_url(path=i.url, lang=lang, trailing_slash=i.slash) }}{%- if i.slash and uglyurls %}index.html{%- endif %}{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>
- {%- if lang != config.default_language %} {{ macros::translate(key=i.name|safe, default=i.name|safe, i18n=i18n) }} {% else %} {{ i.name | safe }} {% endif -%}
+ <li><a{%- if i.size %} class="{{ i.size }}"{% endif %} href="{%- if i.url is matching(pat="^http[s]?://") %}{{ i.url }}{%- else -%}{{ get_url(path=i.url, lang=lang, trailing_slash=i.slash) }}{%- if i.slash and uglyurls %}index.html{%- endif %}{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>
+ {%- if lang != config.default_language %} {{<translate key={i.name | safe} default={i.name | safe} i18n={i18n} />}} {% else %} {{ i.name | safe }} {% endif -%}
</a></li>
{%- endfor -%}
{%- endif -%}
@@ -65,17 +58,17 @@
<li><div class="dropdown"><i class="svgs world" type="reset"></i>
{%- if current_url %}
<div class="dropdown-content">
- <span>{{ macros::translate(key="language_name", default="lang_name", i18n=i18n) }}</span>
+ <span>{{<translate key="language_name" default="lang_name" i18n={i18n} />}}</span>
{%- for lcode,language in config.languages -%}
{%- set i18n_menu = load_data(path="i18n/" ~ lcode ~ '.toml', required=false) -%}
{%- if not i18n_menu -%}{%- set i18n_menu = load_data(path="themes/abridge/i18n/" ~ lcode ~ ".toml", required=false) -%}{%- endif %}
{%- if lang != lcode -%}
{%- if lcode == config.default_language -%}
- <a href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/') | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ macros::translate(key="language_name", default="language_name", i18n=i18n_menu) }}</a>
+ <a href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/') | safe }}{%- if uglyurls %}index.html{%- endif %}">{{<translate key="language_name" default="language_name" i18n={i18n_menu} />}}</a>
{%- elif lang == config.default_language -%}
- <a href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ macros::translate(key="language_name", default="language_name", i18n=i18n_menu) }}</a>
+ <a href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{<translate key="language_name" default="language_name" i18n={i18n_menu} />}}</a>
{%- else -%}
- <a href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/' ~ lcode ~ '/') | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ macros::translate(key="language_name", default="language_name", i18n=i18n_menu) }}</a>
+ <a href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/' ~ lcode ~ '/') | safe }}{%- if uglyurls %}index.html{%- endif %}">{{<translate key="language_name" default="language_name" i18n={i18n_menu} />}}</a>
{%- endif -%}
{%- endif -%}
{%- endfor -%}
@@ -98,7 +91,7 @@
<div>
<form autocomplete=off class="js" name="goSearch" id="searchbox">
<div class="searchd">
- <input id="searchinput" type="text" placeholder="{{ macros::translate(key="Search", default="Search", i18n=i18n) }}" title="Search" />
+ <input id="searchinput" type="text" placeholder="{{<translate key="Search" default="Search" i18n={i18n} />}}" title="Search" />
<button type="submit" title="Search" class="{%- if icon_search -%}{{ icon_search }}{%- else -%}si{%- endif -%}">{%- if not icon_search -%}&#8981;{%- endif -%}</button>
</div>
<div class="results"><div id="suggestions"></div></div>
@@ -136,14 +129,14 @@
{%- if config.extra.menu_footer %}
<nav class="vpad">
{%- for i in config.extra.menu_footer -%}
- {%- if i.url is matching("^http[s]?://") %}
+ {%- if i.url is matching(pat="^http[s]?://") %}
{%- set furl=i.url %}
{%- elif i.url != "sitemap.xml" %}
{%- set furl=get_url(path=i.url, lang=lang, trailing_slash=i.slash) %}
{%- else %}
{%- set furl=get_url(path=i.url, trailing_slash=i.slash) %}
{%- endif %}
- <a class="rpad{%- if i.size %} {{ i.size }}{% endif %}" href="{{ furl | safe }}{%- if i.slash and uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{% if lang != config.default_language %} {{ macros::translate(key=i.name|safe, default=i.name|safe, i18n=i18n) }} {% else %} {{ i.name | safe }} {% endif %}</a>
+ <a class="rpad{%- if i.size %} {{ i.size }}{% endif %}" href="{{ furl | safe }}{%- if i.slash and uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{% if lang != config.default_language %} {{<translate key={i.name | safe} default={i.name | safe} i18n={i18n} />}} {% else %} {{ i.name | safe }} {% endif %}</a>
{%- endfor %}
</nav>
{%- endif %}
@@ -155,7 +148,8 @@
{%- if config.extra.copyright_override -%}
{%- if lang != config.default_language %}
- {%- set copyright_string = macros::translate(key='copyright_override', default='© $CURRENT_YEAR $SITE_TITLE', i18n=i18n) | replace(from="$CURRENT_YEAR", to=current_year) | replace(from="$SITE_TITLE", to=config.title) %}
+ {%- set copyright_string %}{{<translate key="copyright_override" default="© $CURRENT_YEAR $SITE_TITLE" i18n={i18n} />}}{% endset -%}
+ {%- set copyright_string = copyright_string | replace(from="$CURRENT_YEAR", to=current_year) | replace(from="$SITE_TITLE", to=config.title) %}
{% else %}
{%- set copyright_string = config.extra.copyright_override | replace(from="$CURRENT_YEAR", to=current_year) | replace(from="$SITE_TITLE", to=config.title) %}
{% endif -%}
@@ -170,7 +164,7 @@
{%- if config.extra.footer_credit_override %}
{{ config.extra.footer_credit_override | safe }}
{%- else %}
- <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}>{{ macros::translate(key="Powered_by", default="Powered by", i18n=i18n) }} <a href="https://www.getzola.org/" target="_blank">Zola</a> {{ macros::translate(key="and", default="and", i18n=i18n) }} <a href="https://github.com/jieiku/abridge/" target="_blank">Abridge</a></p>
+ <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}>{{<translate key="Powered_by" default="Powered by" i18n={i18n} />}} <a href="https://www.getzola.org/" target="_blank">Zola</a> {{<translate key="and" default="and" i18n={i18n} />}} <a href="https://github.com/jieiku/abridge/" target="_blank">Abridge</a></p>
{%- endif %}
{%- endif %}
</div>
diff --git a/templates/categories/list.html b/templates/categories/list.html
index 4566a75..966fd03 100644
--- a/templates/categories/list.html
+++ b/templates/categories/list.html
@@ -1,26 +1,21 @@
-{% extends "base.html" %}
+{%- extends "base.html" -%}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-
-{%- block seo %}
- {{- super() }}
- {%- set title = "Categories" %}
-
- {%- if config.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
-
+{%- if config.extra.search_library -%}{%- if config.extra.search_library == "offline" -%}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title = "Categories" -%}
+ {%- if config.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} is_home={true} />}}
+{%- endblock seo -%}
{%- block content %}
<div>
<div class="c">
- <h1>{{ terms | length }} {{ macros::translate(key="Categories", default="Categories", i18n=i18n) }} </h1>
+ <h1>{{ terms | length }} {{<translate key="Categories" default="Categories" i18n={i18n} />}} </h1>
<p>{% for term in terms %} [<a href="#{{ term.name }}">{{ term.name }}</a>]<sup>{{ term.pages | length }}</sup> {% endfor %}</p>
</div>
{%- for term in terms %}
diff --git a/templates/categories/single.html b/templates/categories/single.html
index 08b4327..de68a4f 100644
--- a/templates/categories/single.html
+++ b/templates/categories/single.html
@@ -1,22 +1,17 @@
-{% extends "base.html" %}
+{%- extends "base.html" -%}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-
-{%- block seo %}
- {{- super() }}
- {%- set title = term.name ~ " category" %}
-
- {%- if config.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
-
+{%- if config.extra.search_library -%}{%- if config.extra.search_library == "offline" -%}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title = term.name ~ " category" -%}
+ {%- if config.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} is_home={true} />}}
+{%- endblock seo -%}
{%- block content %}
<div>
<h2>{{ term.name }}</h2>
diff --git a/templates/components/audio.html b/templates/components/audio.html
new file mode 100644
index 0000000..f31488d
--- /dev/null
+++ b/templates/components/audio.html
@@ -0,0 +1,30 @@
+{% component audio(page, config, sources, caption="", class="", autoplay=false, loop=false, muted=false, playsinline=false) %}
+{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif %}
+<audio controls{% if class %} class="{{class}}"{% endif %}{% if autoplay %} autoplay{% endif %}{% if loop %} loop{% endif %}{% if muted %} muted{% endif %}{% if playsinline %} playsinline{% endif %}>
+ {% for src in sources %}
+
+ {%- set file = src | split(pat="/") | last %}
+ {%- set dirtest = src | trim_start(pat="./") %}
+ {%- if dirtest is containing(pat="/") %} {%- set reldir = true %} {%- endif %}
+ {%- if page and page.path %}{%- set pagepath = page.path %}{%- elif section and section.path %}{%- set pagepath = section.path %}{%- endif %}
+
+ {%- if src is starting_with(pat="./") and reldir %}{# Relative Path #}
+ {%- set path = (src | trim_start(pat="./") | split(pat="/"))[:-1] | join(sep="/") | trim_start(pat="/") -%}
+ {%- set path = path ~ "/" %}
+
+ {%- elif src is starting_with(pat="/") %}{# Root Path #}
+ {%- set rootpath = (src | split(pat="/"))[:-1] | join(sep="/") -%}
+ {%- set path = (config.base_url if config else "") ~ rootpath ~ "/" %}
+
+ {%- else %}{# Same Directory Path #}
+ {%- set path = "" %}
+
+ {%- endif %}
+
+ {%- set type = src | split(pat=".") | last %}
+ {%- if type is matching(pat="^mov$") %}{% set type = "quicktime" %}{% endif %}
+ <source src="{{ path | safe }}{{ file | safe }}" type="{{ 'audio/' ~ type }}" />
+ {%- endfor -%}Your browser doesn't support the audio tag and/or the audio formats in use here – sorry!</audio>
+{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif %}
+
+{% endcomponent audio %}
diff --git a/templates/macros/macros.html b/templates/components/components.html
index 84ad119..7ce9ef3 100644
--- a/templates/macros/macros.html
+++ b/templates/components/components.html
@@ -1,180 +1,172 @@
-{%- macro translate(key, i18n="", default="") %}
+{# Former macro components #}
+
+{% component translate(key: string, i18n, default="") %}
{{- i18n[key] | default(value=default) | safe -}}
-{%- endmacro %}
+{% endcomponent translate %}
-{%- macro page_listing(page, config) %}
+{%- component page_listing(page, config) %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set uglyurls = true %}{%- endif %}{%- endif %}
<div class="tpad">
<a href="{{ page.permalink | safe}}{%- if uglyurls %}index.html{%- endif %}">{{ page.title | markdown(inline=true) | safe }}</a>
</div>
-{%- endmacro page_listing %}
-
+{%- endcomponent page_listing %}
-{%- macro series_link(inner, page, config) %}
+{%- component series_link(inner, page, config) %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set uglyurls = true %}{%- endif %}{%- endif %}
{%- if inner.content == page.content %}
- <a class="scur" href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
- {% else %}
- <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
+ <a class="scur" href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
+ {%- else %}
+ <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
{%- endif %}
-{%- endmacro %}
-
+{%- endcomponent series_link %}
-{%- macro title_post(page, config) %}
-{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
+{%- component title_post(page, config) %}
+{%- set uglyurls = config.extra.uglyurls | default(value=false) %}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set uglyurls = true %}{%- endif %}{%- endif %}
<h1><a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ page.title | markdown(inline=true) | safe }}</a></h1>
-{%- endmacro title_post %}
-
-
+{%- endcomponent title_post %}
-{%- macro meta_post(page, config) %}
-{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #}
-{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
-{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %}
+{%- component meta_post(page, config) -%}
+{#- Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. -#}
+{%- set i18n = load_data(path="i18n/" ~ page.lang ~ '.toml', required=false) -%}
+{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ page.lang ~ ".toml", required=false) -%}{%- endif -%}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
- <span{%- if config.extra.meta_post.size %} class="{{ config.extra.meta_post.size }}"{% endif %}>
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set uglyurls = true -%}{%- endif %}{%- endif %}
+ <span{%- if config.extra.meta_post?.size %} class="{{ config.extra.meta_post?.size }}"{% endif %}>
{#- Author #}
{%- if page.taxonomies.authors and config.taxonomies %}
{%- for author in page.taxonomies.authors %}
{%- if author_flag %}, {% endif %}
- <a href="{{ get_taxonomy_url(kind='authors', name=author) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ author }}</a>
+ <a href="{{ get_taxonomy_url(kind='authors', term=author) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ author }}</a>
{%- set_global author_flag = true %}
{%- endfor %}
- {%- elif page.extra.authors and config.extra.meta_post.author %}
+ {%- elif page.extra.authors and config.extra.meta_post?.author %}
{%- if config.extra.icon_author %}<i class="{{ config.extra.icon_author }}"></i> {% endif %}
{%- for author in page.extra.authors %}
{%- if author_flag %}, {% endif %} {{ author }}
{%- set_global author_flag = true %}
{%- endfor %}
- {%- elif config.extra.author and config.extra.meta_post.author %}
+ {%- elif config.extra.author and config.extra.meta_post?.author %}
{%- if config.extra.icon_author %}<i class="{{ config.extra.icon_author }}"></i> {% endif %} {{ config.extra.author }}
{%- endif %}
{#- divider #}
- {%- if config.extra.meta_post.author %}
- {%- if config.extra.meta_post.readtime or config.extra.meta_post.date or config.extra.meta_post.updated or config.extra.meta_post.categories_tags %}
- {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}
+ {%- if config.extra.meta_post?.author %}
+ {%- if config.extra.meta_post?.readtime or config.extra.meta_post?.date or config.extra.meta_post?.updated or config.extra.meta_post?.categories_tags %}
+ {%- if config.extra.meta_post?.divider %}<span class="hpad">{{ config.extra.meta_post?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}
{%- endif %}
{%- endif %}
{#- ReadTime #}
- {%- if config.extra.meta_post.readtime %} {%- if config.extra.icon_read %}<i class="{{ config.extra.icon_read }}"></i> {% endif %} {{ page.reading_time }} {{ config.extra.meta_post.readstring | default(value="min") }}
+ {%- if config.extra.meta_post?.readtime %} {%- if config.extra.icon_read %}<i class="{{ config.extra.icon_read }}"></i> {% endif %} {{ page.reading_time }} {{ config.extra.meta_post?.readstring | default(value="min") }}
{#- divider #}
- {%- if config.extra.meta_post.date or config.extra.meta_post.updated or config.extra.meta_post.categories_tags %}
- {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{%- endif %}
+ {%- if config.extra.meta_post?.date or config.extra.meta_post?.updated or config.extra.meta_post?.categories_tags %}
+ {%- if config.extra.meta_post?.divider %}<span class="hpad">{{ config.extra.meta_post?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{%- endif %}
{#- Date #}
- {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %}
- {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%}
- {%- set page_date = page.date | date(format="%B %d, %Y", locale=lang_locale) -%}
+ {%- if config.extra.meta_post?.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %}
+ {%- set lang_locale %}{{<translate key='date_locale' default='en_US' i18n={i18n} />}}{% endset %}
+ {%- set page_date = page.date | date(format="%B %d, %Y", locale=lang_locale) %}
{%- if page_date %} {{ page_date }} {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %}
{#- divider #}
- {%- if config.extra.meta_post.updated or config.extra.meta_post.categories_tags %}
- {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
+ {%- if config.extra.meta_post?.updated or config.extra.meta_post?.categories_tags %}
+ {%- if config.extra.meta_post?.divider %}<span class="hpad">{{ config.extra.meta_post?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
{#- Updated #}
- {%- if config.extra.meta_post.updated and page.updated %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif -%}
- {{ macros::translate(key="Updated", default="Updated", i18n=i18n) }}:
- {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%}
- {%- set page_updated = page.updated | date(format="%B %d, %Y", locale=lang_locale) -%}
+ {%- if config.extra.meta_post?.updated and page.updated %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %}
+ {{<translate key="Updated" default="Updated" i18n={i18n} />}}:
+ {%- set lang_locale %}{{<translate key='date_locale' default='en_US' i18n={i18n} />}}{% endset %}
+ {%- set page_updated = page.updated | date(format="%B %d, %Y", locale=lang_locale) %}
{%- if page_updated %} {{ page_updated }} {%- else %} {{ page.updated | date(format="%B %d, %Y") }} {%- endif %}
{#- divider #}
- {%- if config.extra.meta_post.categories_tags %}
- {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
+ {%- if config.extra.meta_post?.categories_tags %}
+ {%- if config.extra.meta_post?.divider %}<span class="hpad">{{ config.extra.meta_post?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
{#- Categories #}
- {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat, lang=lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ cat }}</a>{%- if not loop.last %}, {% endif %}{% endfor %}]{% endif %}
+ {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', term=cat, lang=page.lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ cat }}</a>{%- if not loop.last %}, {% endif %}{% endfor %}]{% endif %}
{#- Tags #}
- {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span>
-{%- endmacro meta_post %}
-
-
+ {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', term=tag, lang=page.lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor %}{%- endif %}</span>
+{%- endcomponent meta_post %}
-{%- macro title_index(page, config) %}
-{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
+{%- component title_index(page, config) %}
+{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
+{%- if config.extra.search_library -%}{%- if config.extra.search_library == "offline" -%}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
<big>{% if config.extra.title_size_index %}<span class="{{ config.extra.title_size_index }}">{% endif %}<a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ page.title | markdown(inline=true) | safe }}</a>{% if config.extra.title_size_index %}</span>{% endif %}</big>
-{%- endmacro title_index %}
-
+{%- endcomponent title_index -%}
-
-{%- macro meta_index(page, config) %}
-{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #}
-{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
-{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %}
-{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
- <span{%- if config.extra.meta_index.size %} class="{{ config.extra.meta_index.size }}"{% endif %}>
+{%- component meta_index(page, config) %}
+{#- Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. -#}
+{%- set i18n = load_data(path="i18n/" ~ page.lang ~ '.toml', required=false) -%}
+{%- if not i18n %}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ page.lang ~ ".toml", required=false) %}{%- endif %}
+{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
+ <span{%- if config.extra.meta_index?.size %} class="{{ config.extra.meta_index?.size }}"{% endif %}>
{#- Author #}
{%- if page.taxonomies.authors and config.taxonomies %}
{%- for author in page.taxonomies.authors %}
{%- if author_flag %}, {% endif %}
- <a href="{{ get_taxonomy_url(kind='authors', name=author, lang=lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ author }}</a>
+ <a href="{{ get_taxonomy_url(kind='authors', term=author, lang=page.lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ author }}</a>
{%- set_global author_flag = true %}
{%- endfor %}
- {%- elif page.extra.authors and config.extra.meta_index.author %}
+ {%- elif page.extra.authors and config.extra.meta_index?.author %}
{%- if config.extra.icon_author %}<i class="{{ config.extra.icon_author }}"></i> {% endif %}
{%- for author in page.extra.authors %}
{%- if author_flag %}, {% endif %} {{ author }}
{%- set_global author_flag = true %}
{%- endfor %}
- {%- elif config.extra.author and config.extra.meta_index.author %}
+ {%- elif config.extra.author and config.extra.meta_index?.author %}
{%- if config.extra.icon_author %}<i class="{{ config.extra.icon_author }}"></i> {% endif %} {{ config.extra.author }}
{%- endif %}
{#- divider #}
- {%- if config.extra.meta_index.author %}
- {%- if config.extra.meta_index.readtime or config.extra.meta_index.date or config.extra.meta_index.updated or config.extra.meta_index.categories_tags %}
- {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}
+ {%- if config.extra.meta_index?.author %}
+ {%- if config.extra.meta_index?.readtime or config.extra.meta_index?.date or config.extra.meta_index?.updated or config.extra.meta_index?.categories_tags %}
+ {%- if config.extra.meta_index?.divider %}<span class="hpad">{{ config.extra.meta_index?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}
{%- endif %}
{%- endif %}
{#- ReadTime #}
- {%- if config.extra.meta_index.readtime %} {%- if config.extra.icon_read %}<i class="{{ config.extra.icon_read }}"></i> {% endif %} {{ page.reading_time }} {{ config.extra.meta_index.readstring | default(value="min") }}
+ {%- if config.extra.meta_index?.readtime %} {%- if config.extra.icon_read %}<i class="{{ config.extra.icon_read }}"></i> {% endif %} {{ page.reading_time }} {{ config.extra.meta_index?.readstring | default(value="min") }}
{#- divider #}
- {%- if config.extra.meta_index.date or config.extra.meta_index.updated or config.extra.meta_index.categories_tags %}
- {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{%- endif %}
+ {%- if config.extra.meta_index?.date or config.extra.meta_index?.updated or config.extra.meta_index?.categories_tags %}
+ {%- if config.extra.meta_index?.divider %}<span class="hpad">{{ config.extra.meta_index?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{%- endif %}
{#- Date #}
- {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %}
- {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%}
- {%- set page_date = page.date | date(format="%B %d, %Y", locale=lang_locale) -%}
+ {%- if config.extra.meta_index?.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %}
+ {%- set lang_locale %}{{<translate key='date_locale' default='en_US' i18n={i18n} />}}{% endset %}
+ {%- set page_date = page.date | date(format="%B %d, %Y", locale=lang_locale) %}
{%- if page_date %} {{ page_date }} {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %}
{#- divider #}
- {%- if config.extra.meta_index.updated or config.extra.meta_index.categories_tags %}
- {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
+ {%- if config.extra.meta_index?.updated or config.extra.meta_index?.categories_tags %}
+ {%- if config.extra.meta_index?.divider %}<span class="hpad">{{ config.extra.meta_index?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
{#- Updated #}
- {%- if config.extra.meta_index.updated and page.updated %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif -%}
- {{ macros::translate(key="Updated", default="Updated", i18n=i18n) }}:
- {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%}
- {%- set page_updated = page.updated | date(format="%B %d, %Y", locale=lang_locale) -%}
+ {%- if config.extra.meta_index?.updated and page.updated %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i> {% endif %}
+ {{<translate key="Updated" default="Updated" i18n={i18n} />}}:
+ {%- set lang_locale %}{{<translate key='date_locale' default='en_US' i18n={i18n} />}}{% endset %}
+ {%- set page_updated = page.updated | date(format="%B %d, %Y", locale=lang_locale) %}
{%- if page_updated %} {{ page_updated }} {%- else %} {{ page.updated | date(format="%B %d, %Y") }} {%- endif %}
{#- divider #}
- {%- if config.extra.meta_index.categories_tags %}
- {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
+ {%- if config.extra.meta_index?.categories_tags %}
+ {%- if config.extra.meta_index?.divider %}<span class="hpad">{{ config.extra.meta_index?.divider | safe }}</span>{%- else %} <span class="rpad"></span> {%- endif %}{%- endif %}{% endif %}
{#- Categories #}
- {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat, lang=lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ cat }}</a>{%- if not loop.last %}, {% endif %}{% endfor %}]{% endif %}
+ {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i> {% endif %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', term=cat, lang=page.lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ cat }}</a>{%- if not loop.last %}, {% endif %}{% endfor %}]{% endif %}
{#- Tags #}
- {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span>
-{%- endmacro meta_index %}
+ {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', term=tag, lang=page.lang) | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor %}{%- endif %}</span>
+{%- endcomponent meta_index -%}
-
-
-{%- macro footer(page, config) %}
+{%- component footer(page, config) %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
- {#- prev/next content page nextprev title pagination #}
+{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set uglyurls = true %}{%- endif %}{%- endif %}
+ {#- prev/next content page nextprev title pagination -#}
{%- if not config.extra.hide_page_nextprev_titles | default(value=false) %}
{%- if page.lower or page.higher %}
<nav>
@@ -191,12 +183,10 @@
</nav>
{%- endif %}
{%- endif %}
-{%- endmacro footer %}
+{%- endcomponent footer %}
-
-
-{%- macro pagination(paginator, config)%}
-{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
+{% component pagination(paginator, config) %}
+{%- set uglyurls = config.extra.uglyurls | default(value=false) %}
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- if paginator.number_pagers > 1 %}
{%- if paginator.number_pagers <= 5 %} {# 5 or less pager is simple, just display all 5 #}
@@ -227,83 +217,81 @@
{%- endif %}
{%- endif %}
<nav class="vpad">
- {%- set icon_first=config.extra.icon_first | default(value="svgs svgh angll") -%}
- {%- set icon_prev=config.extra.icon_prev | default(value="svgs svgh angl") -%}
- {%- set icon_next=config.extra.icon_next | default(value="svgs svgh angr") -%}
- {%- set icon_last=config.extra.icon_last | default(value="svgs svgh angrr") -%}
- {%- if paginator.previous -%}
+ {%- set icon_first=config.extra.icon_first | default(value="svgs svgh angll") %}
+ {%- set icon_prev=config.extra.icon_prev | default(value="svgs svgh angl") %}
+ {%- set icon_next=config.extra.icon_next | default(value="svgs svgh angr") %}
+ {%- set icon_last=config.extra.icon_last | default(value="svgs svgh angrr") %}
+ {%- if paginator.previous %}
<a class="on outp" href="{{ paginator.first | safe }}{%- if uglyurls %}index.html{%- endif %}" title="First Page">
- {%- if icon_first -%}<i class="{{ icon_first }}" alt="First Page"></i>
- {%- else -%}&#171;
- {%- endif -%}
+ {%- if icon_first %}<i class="{{ icon_first }}" alt="First Page"></i>
+ {%- else %}&#171;
+ {%- endif %}
</a>
- {%- else -%}
+ {%- else %}
<span class="off outp">
- {%- if icon_first -%}<i class="{{ icon_first }}" alt="First Page"></i>
- {%- else -%}&#171;
- {%- endif -%}
+ {%- if icon_first %}<i class="{{ icon_first }}" alt="First Page"></i>
+ {%- else %}&#171;
+ {%- endif %}
</span>
- {%- endif -%}
+ {%- endif %}
- {%- if paginator.previous -%}
+ {%- if paginator.previous %}
<a class="on outp" href="{{ paginator.previous | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Previous Page">
- {%- if icon_prev -%}<i class="{{ icon_prev }}" alt="Previous Page"></i>
- {%- else -%}&#8249;
- {%- endif -%}
+ {%- if icon_prev %}<i class="{{ icon_prev }}" alt="Previous Page"></i>
+ {%- else %}&#8249;
+ {%- endif %}
</a>
- {%- else -%}
+ {%- else %}
<span class="off outp">
- {%- if icon_prev -%}<i class="{{ icon_prev }}" alt="Previous Page"></i>
- {%- else -%}&#8249;
- {%- endif -%}
+ {%- if icon_prev %}<i class="{{ icon_prev }}" alt="Previous Page"></i>
+ {%- else %}&#8249;
+ {%- endif %}
</span>
- {%- endif -%}
+ {%- endif %}
- {%- for i in range(start=start, end=end+1) -%}
- {%- if i == paginator.current_index -%}
+ {%- for i in range(start=start, end=end+1) %}
+ {%- if i == paginator.current_index %}
<a class="inp on cnav" href="#">{{i}}</a>
- {%- elif i > 1 -%}
+ {%- elif i > 1 %}
<a class="inp on" href="{{ paginator.base_url | safe }}{{ i ~ '/' }}{%- if uglyurls %}index.html{%- endif %}">{{i}}</a>
- {%- else -%}
+ {%- else %}
<a class="inp on" href="{{ paginator.first | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ i }}</a>
- {%- endif -%}
- {%- endfor -%}
+ {%- endif %}
+ {%- endfor %}
- {%- if paginator.next -%}
+ {%- if paginator.next %}
<a class="on outp" href="{{ paginator.next | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Next Page">
- {%- if icon_next -%}<i class="{{ icon_next }}" alt="Next Page"></i>
- {%- else -%}&#8250;
- {%- endif -%}
+ {%- if icon_next %}<i class="{{ icon_next }}" alt="Next Page"></i>
+ {%- else %}&#8250;
+ {%- endif %}
</a>
- {%- else -%}
+ {%- else %}
<span class="off outp">
- {%- if icon_next -%}<i class="{{ icon_next }}" alt="Next Page"></i>
- {%- else -%}&#8250;
- {%- endif -%}
+ {%- if icon_next %}<i class="{{ icon_next }}" alt="Next Page"></i>
+ {%- else %}&#8250;
+ {%- endif %}
</span>
- {%- endif -%}
+ {%- endif %}
- {%- if paginator.next -%}
+ {%- if paginator.next %}
<a class="on outp" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" title="Last Page">
- {%- if icon_last -%}<i class="{{ icon_last }}" alt="Last Page"></i>
- {%- else -%}&#187;
- {%- endif -%}
+ {%- if icon_last %}<i class="{{ icon_last }}" alt="Last Page"></i>
+ {%- else %}&#187;
+ {%- endif %}
</a>
- {%- else -%}
+ {%- else %}
<span class="off outp">
- {%- if icon_last -%}<i class="{{ icon_last }}" alt="Last Page"></i>
- {%- else -%}&#187;
- {%- endif -%}
+ {%- if icon_last %}<i class="{{ icon_last }}" alt="Last Page"></i>
+ {%- else %}&#187;
+ {%- endif %}
</span>
- {%- endif -%}
+ {%- endif %}
</nav>
{%- endif %}
-{%- endmacro %}
+{% endcomponent pagination %}
-
-
-{%- macro numpagination(paginator, config)%}
-{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
+{% component numpagination(paginator, config) %}
+{%- set uglyurls = config.extra.uglyurls | default(value=false) %}
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
{%- if paginator.number_pagers > 1 %}
{%- if paginator.number_pagers <= 5 %} {# 5 or less pager is simple, just display all 5 #}
@@ -345,19 +333,19 @@
{%- elif paginator.current_index > 4 and paginator.number_pagers > 6 %}
<a class="inp on" href="{{ paginator.first | safe }}{%- if uglyurls %}index.html{%- endif %}" aria-label="First Page">1</a>
<a class="inp on" href="{{ paginator.base_url | safe }}{{ 2 ~ '/' }}{%- if uglyurls %}index.html{%- endif %}" aria-label="Page 2">2</a>
- {%- elif paginator.current_index > 3 and paginator.number_pagers > 5 -%}
+ {%- elif paginator.current_index > 3 and paginator.number_pagers > 5 %}
<a class="inp on" href="{{ paginator.first | safe }}{%- if uglyurls %}index.html{%- endif %}" aria-label="First Page">1</a>
- {%- endif -%}
+ {%- endif %}
- {%- for i in range(start=start, end=end+1) -%}
- {%- if i == paginator.current_index -%}
+ {%- for i in range(start=start, end=end+1) %}
+ {%- if i == paginator.current_index %}
<a class="inp on cnav" href="#">{{i}}</a>
- {%- elif i > 1 -%}
+ {%- elif i > 1 %}
<a class="inp on" href="{{ paginator.base_url | safe }}{{ i ~ '/' }}{%- if uglyurls %}index.html{%- endif %}" aria-label="Page {{i}}">{{i}}</a>
- {%- else -%}
+ {%- else %}
<a class="inp on" href="{{ paginator.first | safe }}{%- if uglyurls %}index.html{%- endif %}" aria-label="Page {{i}}">{{ i }}</a>
- {%- endif -%}
- {%- endfor -%}
+ {%- endif %}
+ {%- endfor %}
{%- if paginator.number_pagers > paginator.current_index+5 and paginator.number_pagers > 7 %}
<span class="dis outp">...</span>
@@ -372,7 +360,145 @@
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" aria-label="Last Page">{{paginator.number_pagers}}</a>
{%- elif paginator.number_pagers > paginator.current_index+2 and paginator.number_pagers > 5 %}
<a class="inp on" href="{{ paginator.last | safe }}{%- if uglyurls %}index.html{%- endif %}" aria-label="Last Page">{{paginator.number_pagers}}</a>
- {%- endif -%}
+ {%- endif %}
</nav>
{%- endif %}
-{%- endmacro %}
+{% endcomponent numpagination %}
+
+{% component seo( config, title="", title_addition="", description="", type="website", is_home=false, is_404=false, is_page=false, page_images="", page_section="", created_time="2023-05-15T07:07:00-07:00", updated_time="2023-05-15T07:07:00-07:00", page="" ) -%}
+{#- Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. -#}
+{%- set _lang = page.lang if page else config.default_language -%}
+{%- set i18n = load_data(path="i18n/" ~ _lang ~ '.toml', required=false) -%}
+{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ _lang ~ ".toml", required=false) -%}{%- endif -%}
+{%- set lang_locale %}{{<translate key='date_locale' default='en_US' i18n={i18n} />}}{% endset -%}
+{%- if is_404 %}
+ <meta name="robots" content="noindex, follow" />
+{%- else %}
+ <meta name="robots" content="index, follow" />
+ <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
+ <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
+{%- endif %}
+
+{%- if current_url %}
+ {%- set page_url = current_url %}
+{%- else %}
+ {%- set page_url = get_url(path="404.html", trailing_slash=true) %}
+{%- endif %}
+ <title>{{ title ~ title_addition }}</title>
+
+{%- if config.extra?.author %}
+ <meta name="author" content="{{ config.extra?.author }}" />
+{%- endif %}
+{%- if config.extra?.facebook_publisher %}
+ <meta property="article:publisher" content="https://www.facebook.com/{{ config.extra?.facebook_publisher }}" />
+{%- endif %}
+ <meta name="copyright" content="{{ config.title }}" />
+{%- if config.extra?.facebook_author %}
+ <meta property="article:author" content="https://www.facebook.com/{{ config.extra?.facebook_author }}" />
+{%- endif %}
+{%- if page?.description %}
+ <meta name="description" content="{{ page?.description }}" />
+{%- else %}
+ <meta name="description" content="{{ config.description }}" />
+{%- endif %}
+ <link rel="canonical" href="{{ page_url | safe }}" />
+{%- if page?.extra?.keywords and config.extra?.keywords %}
+ <meta name="keywords" content="{{ page?.extra?.keywords }}, {{ config.extra?.keywords }}" />
+{%- elif page?.extra?.keywords %}
+ <meta name="keywords" content="{{ page?.extra?.keywords }}" />
+{%- elif config.extra?.keywords %}
+ <meta name="keywords" content="{{ config.extra?.keywords }}" />
+{%- endif %}
+
+{#- Extra SEO START #}
+{%- if config.extra?.seo | default(value=true) %}
+{%- if not is_404 %}
+
+{%- if config.extra?.google %}
+ <meta name="google-site-verification" content="{{ config.extra?.google | safe }}" />
+{%- endif %}
+
+{%- if config.extra?.bing %}
+ <meta name="msvalidate.01" content="{{ config.extra?.bing | safe}}" />
+{%- endif %}
+ <meta property="og:url" content="{{ page_url | safe }}" />
+ <meta name="twitter:url" content="{{ page_url | safe }}" />
+
+{%- if page?.description %}
+ <meta property="og:description" content="{{ page?.description }}" />
+ <meta name="twitter:description" content="{{ page?.description }}" />
+{%- else %}
+ <meta property="og:description" content="{{ config.description }}" />
+ <meta name="twitter:description" content="{{ config.description}}" />
+{%- endif %}
+
+{%- if page?.title %}
+ <meta property="og:title" content="{{ page?.title }} | {{ config.title }}" />
+ <meta name="twitter:title" content="{{ page?.title }} | {{ config.title }}" />
+{%- else %}
+ <meta property="og:title" content="{{ config.title }}" />
+ <meta name="twitter:title" content="{{ config.title }}" />
+{%- endif %}
+
+
+{#- SEO MEDIA START #}
+{%- if page?.extra?.thumbnail %}
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:image" content="{{ get_url(path=page?.path ~ page?.extra?.thumbnail, trailing_slash=false) }}" />
+ <meta property="og:image" content="{{ get_url(path=page?.path ~ page?.extra?.thumbnail, trailing_slash=false) }}" />
+
+{%- elif page?.extra?.static_thumbnail %}
+ <meta name="twitter:card" content="summary_large_image" />
+ {%- if page?.extra?.static_thumbnail is matching(pat="^http[s]?://") %}
+ <meta name="twitter:image" content="{{ page?.extra?.static_thumbnail }}" />
+ <meta property="og:image" content="{{ page?.extra?.static_thumbnail }}" />
+ {%- else %}
+ <meta name="twitter:image" content="{{ get_url(path=page?.extra?.static_thumbnail, trailing_slash=false) }}" />
+ <meta property="og:image" content="{{ get_url(path=page?.extra?.static_thumbnail, trailing_slash=false) }}" />
+ {%- endif %}
+
+{%- elif config.extra?.banner %}
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:image" content="{{ get_url(path=config.extra?.banner, trailing_slash=false) }}" />
+ <meta property="og:image" content="{{ get_url(path=config.extra?.banner, trailing_slash=false) }}" />
+
+{%- else %}
+ <meta name="twitter:card" content="summary" />
+
+{%- endif %}
+
+{%- if config.extra?.open?.audio %}
+ <meta property="og:audio" content="{{ config.extra?.open?.audio }}" />
+{%- endif %}
+
+{%- if config.extra?.open?.locale %}
+ <meta property="og:locale" content="{{ config.extra?.open?.locale }}" />
+{%- endif %}
+
+{%- if config.extra?.open?.videos %}
+ {%- for video in config.extra?.open?.videos %}
+ <meta property="og:video" content="{{ get_url(path=video) }}" />
+ {%- endfor %}
+{%- endif %}
+
+{#- SEO MEDIA END #}
+ <meta property="og:site_name" content="{{ config.title }}" />
+ <meta property="og:locale" content="{{ lang_locale }}" />
+ <meta property="og:type" content="website" />
+{%- if page?.updated %}
+ <meta property="og:updated_time" content="{{ page?.updated | date(format='%F') }}" />
+{%- elif page?.date %}
+ <meta property="og:updated_time" content="{{ page?.date | date(format='%F') }}" />
+{%- else %}
+ <meta property="og:updated_time" content="{{ updated_time }}" />
+{%- endif %}
+
+{%- if config.extra?.twitter_meta %}
+ <meta name="twitter:site" content="@{{ config.extra?.twitter_meta }}" />
+ <meta name="twitter:creator" content="@{{ config.extra?.twitter_meta }}" />
+{%- endif -%}
+{%- endif -%}
+{%- endif -%}
+{#- Extra SEO END -#}
+{% endcomponent seo %}
+
diff --git a/templates/components/gif.html b/templates/components/gif.html
new file mode 100644
index 0000000..cf4d264
--- /dev/null
+++ b/templates/components/gif.html
@@ -0,0 +1,30 @@
+{% component gif(page, config, sources, caption="", class="", w=0, h=0) %}
+{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif %}
+<video controls{% if class %} class="{{class}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} autoplay loop muted playsinline>
+ {% for src in sources %}
+
+ {%- set video = src | split(pat="/") | last %}
+ {%- set dirtest = src | trim_start(pat="./") %}
+ {%- if dirtest is containing(pat="/") %} {%- set reldir = true %} {%- endif %}
+ {%- if page and page.path %}{%- set pagepath = page.path %}{%- elif section and section.path %}{%- set pagepath = section.path %}{%- endif %}
+
+ {%- if src is starting_with(pat="./") and reldir %}{# Relative Path #}
+ {%- set path = (src | trim_start(pat="./") | split(pat="/"))[:-1] | join(sep="/") | trim_start(pat="/") -%}
+ {%- set path = path ~ "/" %}
+
+ {%- elif src is starting_with(pat="/") %}{# Root Path #}
+ {%- set rootpath = (src | split(pat="/"))[:-1] | join(sep="/") -%}
+ {%- set path = (config.base_url if config else "") ~ rootpath ~ "/" %}
+
+ {%- else %}{# Same Directory Path #}
+ {%- set path = "" %}
+
+ {%- endif %}
+
+ {%- set type = src | split(pat=".") | last %}
+ {%- if type is matching(pat="^mov$") %}{% set type = "quicktime" %}{% endif %}
+ <source src="{{ path | safe }}{{ video | safe }}" type="{{ 'video/' ~ type }}" />
+ {%- endfor -%}Your browser doesn't support the video tag and/or the video formats in use here – sorry!</video>
+{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif %}
+
+{% endcomponent gif %}
diff --git a/templates/shortcodes/image.html b/templates/components/image.html
index 22b8f2d..c8230e1 100644
--- a/templates/shortcodes/image.html
+++ b/templates/components/image.html
@@ -1,18 +1,19 @@
-{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%}
+{% component image(page, config, sources, caption="", class="", alt="", w=0, h=0) %}
+{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif %}
<picture{% if class %} class="{{class}}"{% endif %}>
{%- for src in sources %}
{%- set video = src | split(pat="/") | last %}
- {%- set dirtest = src | trim_start_matches(pat="./") %}
- {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %}
- {%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %}
+ {%- set dirtest = src | trim_start(pat="./") %}
+ {%- if dirtest is containing(pat="/") %} {%- set reldir = true %} {%- endif %}
+ {%- if page and page.path %}{%- set pagepath = page.path %}{%- elif section and section.path %}{%- set pagepath = section.path %}{%- endif %}
- {%- if src is starting_with("./") and reldir %}{# Relative Path #}
- {%- set path = src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
+ {%- if src is starting_with(pat="./") and reldir %}{# Relative Path #}
+ {%- set path = (src | trim_start(pat="./") | split(pat="/"))[:-1] | join(sep="/") | trim_start(pat="/") -%}
{%- set path = path ~ "/" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ path ~ video | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ path ~ video) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ path ~ video %}
{%- endif %}
@@ -21,9 +22,9 @@
{%- set h = meta.height %}
{%- endif %}
- {%- elif src is starting_with("/") %}{# Root Path #}
- {%- set rootpath = src | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {%- set path = config.base_url ~ rootpath ~ "/" %}
+ {%- elif src is starting_with(pat="/") %}{# Root Path #}
+ {%- set rootpath = (src | split(pat="/"))[:-1] | join(sep="/") -%}
+ {%- set path = (config.base_url if config else "") ~ rootpath ~ "/" %}
{%- if not w or not h %}
{%- set metapath = rootpath ~ "/" ~ video %}
{%- set meta = get_image_metadata(path=metapath) %}
@@ -34,8 +35,8 @@
{%- else %}{# Same Directory Path #}
{%- set path = "" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ video | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ video) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ video %}
{%- endif %}
@@ -46,8 +47,8 @@
{%- endif %}
- {%- set type = src | split(pat=".") | last -%}
- {%- if type is matching("^mov$") %}{%- set type = "quicktime" -%}{% endif -%}
+ {%- set type = src | split(pat=".") | last %}
+ {%- if type is matching(pat="^mov$") %}{%- set type = "quicktime" %}{% endif %}
{%- if loop.last %}
{%- if not alt %}
{%- set alt = video | split(pat=".") | first %}
@@ -58,4 +59,6 @@
{%- endif %}
{%- endfor %}
</picture>
-{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif -%}
+{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif %}
+
+{% endcomponent image %}
diff --git a/templates/shortcodes/img.html b/templates/components/img.html
index ed84aa5..6aa5b2e 100644
--- a/templates/shortcodes/img.html
+++ b/templates/components/img.html
@@ -1,14 +1,15 @@
+{% component img(page, config, src, caption="", class="", alt="", w=0, h=0, link="") %}
{%- set img = src | split(pat="/") | last %}
-{%- set dirtest = src | trim_start_matches(pat="./") %}
-{%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %}
-{%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %}
+{%- set dirtest = src | trim_start(pat="./") %}
+{%- if dirtest is containing(pat="/") %} {%- set reldir = true %} {%- endif %}
+{%- if page and page.path %}{%- set pagepath = page.path %}{%- elif section and section.path %}{%- set pagepath = section.path %}{%- endif %}
-{%- if src is starting_with("./") and reldir %} {# Relative Path #}
- {%- set path = src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
+{%- if src is starting_with(pat="./") and reldir %} {# Relative Path #}
+ {%- set path = (src | trim_start(pat="./") | split(pat="/"))[:-1] | join(sep="/") | trim_start(pat="/") -%}
{%- set path = path ~ "/" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ path ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ path ~ img) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ path ~ img %}
{%- endif %}
@@ -17,9 +18,9 @@
{%- set h = meta.height %}
{%- endif %}
-{%- elif src is starting_with("/") %} {# Root Path #}
- {%- set rootpath = src | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {%- set path = config.base_url ~ rootpath ~ "/" %}
+{%- elif src is starting_with(pat="/") %} {# Root Path #}
+ {%- set rootpath = (src | split(pat="/"))[:-1] | join(sep="/") -%}
+ {%- set path = (config.base_url if config else "") ~ rootpath ~ "/" %}
{%- if not w or not h %}
{%- set metapath = rootpath ~ "/" ~ img %}
{%- set meta = get_image_metadata(path=metapath) %}
@@ -30,8 +31,8 @@
{%- else %} {# Same Directory Path #}
{%- set path = "" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ img) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ img %}
{%- endif %}
@@ -44,6 +45,8 @@
{%- if not alt %}
{%- set alt = img | split(pat=".") | first %}
{%- endif %}
-{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%}
-{%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}"{% if class %} class="{{class}}"{% endif %}{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif -%}
+{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif %}
+{%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}"{% if class %} class="{{class}}"{% endif %}{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif %}
{%- if caption %}<figcaption>{{ caption | safe }}</figcaption></figure>{%- endif %}
+
+{% endcomponent img %}
diff --git a/templates/shortcodes/imgswap.html b/templates/components/imgswap.html
index a6f7b83..b260615 100644
--- a/templates/shortcodes/imgswap.html
+++ b/templates/components/imgswap.html
@@ -1,15 +1,16 @@
+{% component imgswap(page, config, main_src, swap_src, caption="", class="", alt="", w=0, h=0) %}
<div class="img-swap-div">
{%- set img = main_src | split(pat="/") | last %}
- {%- set dirtest = main_src | trim_start_matches(pat="./") %}
- {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %}
- {%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %}
+ {%- set dirtest = main_src | trim_start(pat="./") %}
+ {%- if dirtest is containing(pat="/") %} {%- set reldir = true %} {%- endif %}
+ {%- if page and page.path %}{%- set pagepath = page.path %}{%- elif section and section.path %}{%- set pagepath = section.path %}{%- endif %}
- {%- if main_src is starting_with("./") and reldir %} {# Relative Path #}
- {%- set path = main_src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
+ {%- if main_src is starting_with(pat="./") and reldir %} {# Relative Path #}
+ {%- set path = (main_src | trim_start(pat="./") | split(pat="/"))[:-1] | join(sep="/") | trim_start(pat="/") -%}
{%- set path = path ~ "/" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ path ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ path ~ img) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ path ~ img %}
{%- endif %}
@@ -18,9 +19,9 @@
{%- set h = meta.height %}
{%- endif %}
- {%- elif main_src is starting_with("/") %} {# Root Path #}
- {%- set rootpath = main_src | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {%- set path = config.base_url ~ rootpath ~ "/" %}
+ {%- elif main_src is starting_with(pat="/") %} {# Root Path #}
+ {%- set rootpath = (main_src | split(pat="/"))[:-1] | join(sep="/") -%}
+ {%- set path = (config.base_url if config else "") ~ rootpath ~ "/" %}
{%- if not w or not h %}
{%- set metapath = rootpath ~ "/" ~ img %}
{%- set meta = get_image_metadata(path=metapath) %}
@@ -31,8 +32,8 @@
{%- else %} {# Same Directory Path #}
{%- set path = "" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ img) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ img %}
{%- endif %}
@@ -45,20 +46,20 @@
{%- if not alt %}
{%- set alt = img | split(pat=".") | first %}
{%- endif %}
- {%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%}
- {%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}" class="img-main{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif -%}
+ {%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif %}
+ {%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}" class="img-main{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif %}
{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{%- endif %}
{%- set img = swap_src | split(pat="/") | last %}
- {%- set dirtest = swap_src | trim_start_matches(pat="./") %}
- {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %}
+ {%- set dirtest = swap_src | trim_start(pat="./") %}
+ {%- if dirtest is containing(pat="/") %} {%- set reldir = true %} {%- endif %}
- {%- if swap_src is starting_with("./") and reldir %} {# Relative Path #}
- {%- set path = swap_src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
+ {%- if swap_src is starting_with(pat="./") and reldir %} {# Relative Path #}
+ {%- set path = (swap_src | trim_start(pat="./") | split(pat="/"))[:-1] | join(sep="/") | trim_start(pat="/") -%}
{%- set path = path ~ "/" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ path ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ path ~ img) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ path ~ img %}
{%- endif %}
@@ -67,9 +68,9 @@
{%- set h = meta.height %}
{%- endif %}
- {%- elif swap_src is starting_with("/") %} {# Root Path #}
- {%- set rootpath = swap_src | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {%- set path = config.base_url ~ rootpath ~ "/" %}
+ {%- elif swap_src is starting_with(pat="/") %} {# Root Path #}
+ {%- set rootpath = (swap_src | split(pat="/"))[:-1] | join(sep="/") -%}
+ {%- set path = (config.base_url if config else "") ~ rootpath ~ "/" %}
{%- if not w or not h %}
{%- set metapath = rootpath ~ "/" ~ img %}
{%- set meta = get_image_metadata(path=metapath) %}
@@ -80,8 +81,8 @@
{%- else %} {# Same Directory Path #}
{%- set path = "" %}
{%- if not w or not h %}
- {%- if lang != config.default_language %}
- {%- set metapath = pagepath ~ img | replace(from=pagepath | truncate(length=4, end=""), to="/") %}
+ {%- if page.lang != config.default_language %}
+ {%- set metapath = (pagepath ~ img) | replace(from="/" ~ page.lang ~ "/", to="/") %}
{%- else %}
{%- set metapath = pagepath ~ img %}
{%- endif %}
@@ -94,7 +95,9 @@
{%- if not alt %}
{%- set alt = img | split(pat=".") | first %}
{%- endif %}
- {%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%}
- {%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}" class="img-swap{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif -%}
+ {%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif %}
+ {%- if link %}<a href="{{link | safe}}">{% endif %}<img src="{{ path | safe }}{{ img | safe }}" class="img-swap{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />{% if link %}</a>{% endif %}
{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{%- endif %}
</div>
+
+{% endcomponent imgswap %}
diff --git a/templates/components/katex.html b/templates/components/katex.html
new file mode 100644
index 0000000..71e27dd
--- /dev/null
+++ b/templates/components/katex.html
@@ -0,0 +1,3 @@
+{% component katex(block=false) %}
+<script type="math/tex{% if block %};mode=display{% endif %}">{{ body | safe }}</script>
+{% endcomponent katex %}
diff --git a/templates/components/showdata.html b/templates/components/showdata.html
new file mode 100644
index 0000000..2aba3b1
--- /dev/null
+++ b/templates/components/showdata.html
@@ -0,0 +1,9 @@
+{%- component showdata(page, config, src, type="", key="") -%}
+{%- if src and key and type -%}
+{%- if src is matching(pat="^http[s]?://") -%}{%- set data = load_data(url=src, format=type) -%}{%- else -%}{%- set data = load_data(path=src, format=type) -%}{%- endif -%}
+{{- data[key] }}
+{%- else -%}
+{%- if src is matching(pat="^http[s]?://") -%}{%- set data = load_data(url=src) -%}{%- else -%}{%- set data = load_data(path=src) -%}{%- endif -%}
+{{- data }}
+{%- endif -%}
+{%- endcomponent showdata -%}
diff --git a/templates/shortcodes/streamable.html b/templates/components/streamable.html
index 7df8e9e..94dfc45 100644
--- a/templates/shortcodes/streamable.html
+++ b/templates/components/streamable.html
@@ -1,3 +1,5 @@
+{% component streamable(id, class="", title="") %}
<div class="yv{% if class %} {{class}}{% endif %}">
<iframe src="https://www.streamable.com/e/{{id}}" title="{{title | default(value='Streamable') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
+{% endcomponent streamable %}
diff --git a/templates/components/video.html b/templates/components/video.html
new file mode 100644
index 0000000..ee8130d
--- /dev/null
+++ b/templates/components/video.html
@@ -0,0 +1,30 @@
+{% component video(page, config, sources, caption="", class="", w=0, h=0, autoplay=false, loop=false, muted=false, playsinline=false) %}
+{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif %}
+<video controls{% if class %} class="{{class}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %}{% if autoplay %} autoplay{% endif %}{% if loop %} loop{% endif %}{% if muted %} muted{% endif %}{% if playsinline %} playsinline{% endif %}>
+ {% for src in sources %}
+
+ {%- set video = src | split(pat="/") | last %}
+ {%- set dirtest = src | trim_start(pat="./") %}
+ {%- if dirtest is containing(pat="/") %} {%- set reldir = true %} {%- endif %}
+ {%- if page and page.path %}{%- set pagepath = page.path %}{%- elif section and section.path %}{%- set pagepath = section.path %}{%- endif %}
+
+ {%- if src is starting_with(pat="./") and reldir %}{# Relative Path #}
+ {%- set path = (src | trim_start(pat="./") | split(pat="/"))[:-1] | join(sep="/") | trim_start(pat="/") -%}
+ {%- set path = path ~ "/" %}
+
+ {%- elif src is starting_with(pat="/") %}{# Root Path #}
+ {%- set rootpath = (src | split(pat="/"))[:-1] | join(sep="/") -%}
+ {%- set path = (config.base_url if config else "") ~ rootpath ~ "/" %}
+
+ {%- else %}{# Same Directory Path #}
+ {%- set path = "" %}
+
+ {%- endif %}
+
+ {%- set type = src | split(pat=".") | last %}
+ {%- if type is matching(pat="^mov$") %}{% set type = "quicktime" %}{% endif %}
+ <source src="{{ path | safe }}{{ video | safe }}" type="{{ 'video/' ~ type }}" />
+ {%- endfor -%}Your browser doesn't support the video tag and/or the video formats in use here – sorry!</video>
+{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif %}
+
+{% endcomponent video %}
diff --git a/templates/shortcodes/vimeo.html b/templates/components/vimeo.html
index 0fe3129..d5a9e70 100644
--- a/templates/shortcodes/vimeo.html
+++ b/templates/components/vimeo.html
@@ -1,3 +1,5 @@
+{% component vimeo(id, class="", title="", autoplay=false, loop=false, noautopause=false, cookie=true) %}
<div class="yv{% if class %} {{class}}{% endif %}">
<iframe src="https://player.vimeo.com/video/{{id}}?embedded=true{% if autoplay %}&autoplay=1{% endif %}{% if loop %}&loop=1{% endif %}{% if noautopause %}&autopause=0{% endif %}{% if not cookie %}&dnt=1{% endif %}" title="{{title | default(value='Vimeo') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
+{% endcomponent vimeo %}
diff --git a/templates/shortcodes/youtube.html b/templates/components/youtube.html
index d07b91b..1022825 100644
--- a/templates/shortcodes/youtube.html
+++ b/templates/components/youtube.html
@@ -1,3 +1,5 @@
+{% component youtube(id, class="", title="", playlist="", autoplay=false, cookie=false) %}
<div class="yv{% if class %} {{class}}{% endif %}">
<iframe src="https://www.youtube{% if not cookie %}-nocookie{% endif %}.com/embed/{{id}}{% if playlist %}?list={{playlist}}{% endif %}{% if autoplay %}?autoplay=1{% endif %}" title="{{title | default(value='Youtube') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
+{% endcomponent youtube %}
diff --git a/templates/index.html b/templates/index.html
index e5da411..3c2c1b1 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,44 +2,40 @@
This Template Shows a paginated page of the Posts of a section with a short summary.
This Template can also be used directly for the index eg: example.com/ or as the rendering template for Sections, eg: example.com/blog/ example.com/software/
#}
-
{%- extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-{%- block seo %}
- {{- super() }}
-
- {%- if config.title %}
- {%- set title = config.title %}
- {%- else %}
- {%- set title = "" %}
- {%- endif %}
-
- {%- if config.extra.title_addition and title %}
- {%- set title_addition = title_separator ~ config.extra.title_addition %}
- {%- elif config.extra.title_addition %}
- {%- set title_addition = config.extra.title_addition %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
+{%- block seo -%}
+ {{- super() -}}
+ {%- if config.title -%}
+ {%- set title = config.title -%}
+ {%- else -%}
+ {%- set title = "" -%}
+ {%- endif -%}
+ {%- if config.extra.title_addition and title -%}
+ {%- set title_addition = title_separator ~ config.extra.title_addition -%}
+ {%- elif config.extra.title_addition -%}
+ {%- set title_addition = config.extra.title_addition -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} is_home={true} />}}
+{%- endblock seo -%}
{%- block content %}
<div>
- {%- for page in paginator.pages %}
+ {%- set pages = paginator.pages if paginator else section.pages %}
+ {% for page in pages %}
<article>
- {{- macros::title_index(page=page, config=config) }}
- {%- if config.extra.meta_index.position %}
- {%- if config.extra.meta_index.position == "top" or config.extra.meta_index.position == "both" %}
- {{- macros::meta_index(page=page, config=config) }}
+ {{<title_index page={page} config={config} />}}
+ {%- if config.extra.meta_index?.position %}
+ {%- if config.extra.meta_index?.position == "top" or config.extra.meta_index?.position == "both" %}
+ {{<meta_index page={page} config={config} />}}
{%- endif %}{%- endif %}
<div class="sum">
<p>
@@ -52,33 +48,33 @@ This Template can also be used directly for the index eg: example.com/ or as the
{%- elif page.extra.static_thumbnail %}
{%- endif %}
<a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">
- ...{{ macros::translate(key="more", default="more", i18n=i18n) }}
+ ...{{<translate key="more" default="more" i18n={i18n} />}}
</a>
</p>
</div>
- {%- if config.extra.meta_index.position %}
- {%- if config.extra.meta_index.position == "bottom" or config.extra.meta_index.position == "both" %}
- {{- macros::meta_index(page=page, config=config) }}
+ {%- if config.extra.meta_index?.position %}
+ {%- if config.extra.meta_index?.position == "bottom" or config.extra.meta_index?.position == "both" %}
+ {{<meta_index page={page} config={config} />}}
{%- endif %}
{%- endif %}
</article>
{%- endfor %}
{%- if config.extra.arrow_pagination %}
- {{- macros::pagination(paginator=paginator, config=config) }}
+ {%- if paginator %}{{<pagination paginator={paginator} config={config} />}}{% endif %}
{%- else %}
- {{- macros::numpagination(paginator=paginator, config=config) }}
+ {%- if paginator %}{{<numpagination paginator={paginator} config={config} />}}{% endif %}
{%- endif %}
</div>
{%- if config.extra.recent | default(value=true) %}
{#- The following line is checking if the template is being used for the root or a section #}
- {%- if current_path is matching("^(/[[:alpha:]][[:alpha:]])?(/page/[[:digit:]]+)?/$") %}
+ {%- if current_path is matching(pat="^(/[[:alpha:]][[:alpha:]])?(/page/[[:digit:]]+)?/$") %}
{%- set sec = "" %}
{%- else %}
{%- if lang == config.default_language %}
- {%- set sec = current_path | trim_start_matches(pat="/") | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %}
+ {%- set sec = current_path | trim_start(pat="/") | split(pat="/page/") | first | trim_end(pat="/") %}
{%- set sec = sec ~ "/" %}
{%- else %}
- {%- set sec = current_path | trim_start_matches(pat="/" ~ lang ~ "/") | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %}
+ {%- set sec = current_path | trim_start(pat="/" ~ lang ~ "/") | split(pat="/page/") | first | trim_end(pat="/") %}
{%- set sec = sec ~ "/" %}
{%- endif %}
{%- endif %}
@@ -90,10 +86,10 @@ This Template can also be used directly for the index eg: example.com/ or as the
{%- endif %}
<div class="sblock">
<div class="blockdiv sticky">
- <span class="b s150">{{ macros::translate(key="Recent", default="Recent", i18n=i18n) }}</span>
+ <span class="b s150">{{<translate key="Recent" default="Recent" i18n={i18n} />}}</span>
{%- set recent_items=config.extra.recent_items | default(value=9) -%}
- {%- for page in section_item.pages | slice(end=recent_items) %}
- {{- macros::page_listing(page=page, config=config) }}
+ {%- for page in section_item.pages[:recent_items] -%}
+ {{<page_listing page={page} config={config} />}}
{%- endfor %}
</div>
</div>
diff --git a/templates/macros/seo.html b/templates/macros/seo.html
deleted file mode 100644
index d8853be..0000000
--- a/templates/macros/seo.html
+++ /dev/null
@@ -1,145 +0,0 @@
-{#- type: website or article, generally setting article for blog articles -#}
-{#- page_images: using for the blog single template page -#}
-{#- page_section: the blog single template page have to pass the parameter -#}
-{#- is_404: using for the 404.html template -#}
-
-{%- macro seo( config, title="", title_addition="", description="", type="website", is_home=false, is_404=false, is_page=false, page_images="", page_section="", created_time="2023-05-15T07:07:00-07:00", updated_time="2023-05-15T07:07:00-07:00" ) %}
-
-{#- Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #}
-{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
-{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %}
-{%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%}
-
-{%- if is_404 -%}
- <meta name="robots" content="noindex, follow" />
-{%- else -%}
- <meta name="robots" content="index, follow" />
- <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
- <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
-{%- endif -%}
-
-{%- if current_url %}
- {%- set page_url = current_url %}
-{%- else %}
- {%- set page_url = get_url(path="404.html", trailing_slash=true) %}
-{%- endif %}
- <title>{{ title ~ title_addition }}</title>
-
-{%- if config.extra.author %}
- <meta name="author" content="{{ config.extra.author }}" />
-{%- endif %}
-{%- if config.extra.facebook_publisher %}
- <meta property="article:publisher" content="https://www.facebook.com/{{ config.extra.facebook_publisher }}" />
-{%- endif %}
- <meta name="copyright" content="{{ config.title }}" />
-{%- if config.extra.facebook_author %}
- <meta property="article:author" content="https://www.facebook.com/{{ config.extra.facebook_author }}" />
-{%- endif %}
-{%- if page.description %}
- <meta name="description" content="{{ page.description }}" />
-{%- else %}
- <meta name="description" content="{{ config.description }}" />
-{%- endif %}
- <link rel="canonical" href="{{ page_url | safe }}" />
-{%- if page.extra.keywords and config.extra.keywords %}
- <meta name="keywords" content="{{ page.extra.keywords }}, {{ config.extra.keywords }}" />
-{%- elif page.extra.keywords %}
- <meta name="keywords" content="{{ page.extra.keywords }}" />
-{%- elif config.extra.keywords %}
- <meta name="keywords" content="{{ config.extra.keywords }}" />
-{%- endif %}
-
-{#- Extra SEO START #}
-{%- if config.extra.seo | default(value=true) %}
-{%- if not is_404 %}
-
-{%- if config.extra.google %}
- <meta name="google-site-verification" content="{{ config.extra.google | safe }}" />
-{%- endif %}
-
-{%- if config.extra.bing %}
- <meta name="msvalidate.01" content="{{ config.extra.bing | safe}}" />
-{%- endif %}
- <meta property="og:url" content="{{ page_url | safe }}" />
- <meta name="twitter:url" content="{{ page_url | safe }}" />
-
-{%- if page.description %}
- <meta property="og:description" content="{{ page.description }}" />
- <meta name="twitter:description" content="{{ page.description }}" />
-{%- else %}
- <meta property="og:description" content="{{ config.description }}" />
- <meta name="twitter:description" content="{{ config.description}}" />
-{%- endif %}
-
-{%- if page.title %}
- <meta property="og:title" content="{{ page.title }} | {{ config.title }}" />
- <meta name="twitter:title" content="{{ page.title }} | {{ config.title }}" />
-{%- else %}
- <meta property="og:title" content="{{ config.title }}" />
- <meta name="twitter:title" content="{{ config.title }}" />
-{%- endif %}
-
-
-{#- SEO MEDIA START #}
-{%- if page.extra.thumbnail %}
- <meta name="twitter:card" content="summary_large_image" />
- <meta name="twitter:image" content="{{ get_url(path=page.path ~ page.extra.thumbnail, trailing_slash=false) }}" />
- <meta property="og:image" content="{{ get_url(path=page.path ~ page.extra.thumbnail, trailing_slash=false) }}" />
-
-{%- elif page.extra.static_thumbnail %}
- <meta name="twitter:card" content="summary_large_image" />
- {%- if page.extra.static_thumbnail is matching("^http[s]?://") %}
- <meta name="twitter:image" content="{{ page.extra.static_thumbnail }}" />
- <meta property="og:image" content="{{ page.extra.static_thumbnail }}" />
- {%- else %}
- <meta name="twitter:image" content="{{ get_url(path=page.extra.static_thumbnail, trailing_slash=false) }}" />
- <meta property="og:image" content="{{ get_url(path=page.extra.static_thumbnail, trailing_slash=false) }}" />
- {%- endif %}
-
-{%- elif config.extra.banner %}
- <meta name="twitter:card" content="summary_large_image" />
- <meta name="twitter:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}" />
- <meta property="og:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}" />
-
-{%- else %}
- <meta name="twitter:card" content="summary" />
-
-{%- endif %}
-
-{%- if config.extra.open.audio %}
- <meta property="og:audio" content="{{ config.extra.open.audio }}" />
-{%- endif %}
-
-{%- if config.extra.open.locale %}
- <meta property="og:locale" content="{{ config.extra.open.locale }}" />
-{%- endif %}
-
-{%- if config.extra.open.videos %}
- {%- for video in config.extra.open.videos %}
- <meta property="og:video" content="{{ get_url(path=video) }}" />
- {%- endfor %}
-{%- endif %}
-
-{#- SEO MEDIA END #}
- <meta property="og:site_name" content="{{ config.title }}" />
- <meta property="og:locale" content="{{ lang_locale }}" />
- <meta property="og:type" content="website" />
-{%- if page.updated %}
- <meta property="og:updated_time" content="{{ page.updated | date(format='%F') }}" />
-{%- elif page.date %}
- <meta property="og:updated_time" content="{{ page.date | date(format='%F') }}" />
-{%- else %}
- <meta property="og:updated_time" content="{{ updated_time }}" />
-{%- endif %}
-
-{%- if config.extra.twitter_meta %}
- <meta name="twitter:site" content="@{{ config.extra.twitter_meta }}" />
- <meta name="twitter:creator" content="@{{ config.extra.twitter_meta }}" />
-{%- endif %}
-
-
-
-{%- endif %}
-{%- endif %}
-{#- Extra SEO END #}
-{%- endmacro %}
diff --git a/templates/page.html b/templates/page.html
index 10ea571..6615602 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -1,43 +1,39 @@
-{# This Template Shows the Individual Blog Posts#}
-
-{% extends "base.html" %}
-
-{%- block seo %}
- {{- super() }}
- {%- set title_addition = "" %}
- {%- if page.title and config.title %}
- {%- set title = page.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- elif page.title %}
- {%- set title = page.title %}
- {%- else %}
- {%- set title = config.title %}
- {%- endif %}
-
- {%- if page.description %}
- {%- set description = page.description %}
- {%- else %}
- {%- set description = config.description %}
- {%- endif %}
- {%- set created_time = page.date %}
- {%- set updated_time = page.updated %}
- {%- if current_section %}
- {%- set page_section = current_section %}
- {%- else %}
- {%- set page_section = "" %}
- {%- endif %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, type="article", is_page=true, created_time=created_time, updated_time=updated_time, page_section=page_section) }}
-{%- endblock seo %}
+{#- This Template Shows the Individual Blog Posts -#}
+{%- extends "base.html" -%}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title_addition = "" -%}
+ {%- if page.title and config.title -%}
+ {%- set title = page.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- elif page.title -%}
+ {%- set title = page.title -%}
+ {%- else -%}
+ {%- set title = config.title -%}
+ {%- endif -%}
+ {%- if page.description -%}
+ {%- set description = page.description -%}
+ {%- else -%}
+ {%- set description = config.description -%}
+ {%- endif -%}
+ {%- set created_time = page.date or "" -%}
+ {%- set updated_time = page.updated or page.date or "" -%}
+ {%- if current_section -%}
+ {%- set page_section = current_section -%}
+ {%- else -%}
+ {%- set page_section = "" -%}
+ {%- endif -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} type="article" is_page={true} created_time={created_time} updated_time={updated_time} page_section={page_section} />}}
+{%- endblock seo -%}
{%- block comments_init %}
- {%- if not config.extra.comment_system or config.extra.comment_system == "hyvor" and config.extra.comments.hyvor %}
+ {%- if config.extra.comment_system == "hyvor" and config.extra.comments?.hyvor %}
<script defer src="https://talk.hyvor.com/embed/embed.js" type="module"></script>
- {%- elif config.extra.comment_system == "remark42" and config.extra.comments.remark42 %}
+ {%- elif config.extra.comment_system == "remark42" and config.extra.comments?.remark42 %}
<script>
var remark_config = {
- host: "{{ config.extra.comments.remark42 | safe }}",
- site_id: "{{ config.extra.comments.remark42_site_id }}",
+ host: "{{ config.extra.comments?.remark42 | safe }}",
+ site_id: "{{ config.extra.comments?.remark42_site_id }}",
}
</script>
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>
@@ -46,63 +42,59 @@
{%- block content %}
<article>
+ {%- block page_header -%}
+ {{<title_post page={page} config={config} />}}
- {%- block page_header %}
- {{- macros::title_post(page=page, config=config) }}
-
- {%- if config.extra.meta_post.position %}
- {%- if config.extra.meta_post.position == "top" or config.extra.meta_post.position == "both" %}
- {{- macros::meta_post(page=page, config=config) }}
+ {%- if config.extra.meta_post?.position %}
+ {%- if config.extra.meta_post?.position == "top" or config.extra.meta_post?.position == "both" %}
+ {{<meta_post page={page} config={config} />}}
{%- endif %}{%- endif %}
{%- endblock page_header %}
- {# In Page Series Navigation #}
+ {#- In Page Series Navigation #}
{%- if config.extra.series | default(value=true) %}
{%- if page.extra.series %}
{%- set tag = get_taxonomy_term(kind="tags", term=page.extra.series, lang=lang) %}
- {%- set page_num = tag.page_count | as_str %}
+ {%- set page_num = tag.page_count | str %}
{%- if lang != config.default_language %}
- {%- set parts_string = macros::translate(key='Series_parts', default='Series', i18n=i18n) | replace(from="$NUMBER_OF_PARTS", to=page_num) %}
- {% else %}
+ {%- set parts_string %}{{<translate key="Series_parts" default="Series" i18n={i18n} />}}{%- endset %}
+ {%- set parts_string = parts_string | replace(from="$NUMBER_OF_PARTS", to=page_num) %}
+ {%- else %}
{%- set parts_string = config.extra.Series_parts | default(value="Series") | replace(from="$NUMBER_OF_PARTS", to=page_num) %}
- {% endif -%}
+ {%- endif %}
- <div class="block">
- <div class="blockdiv">
- <a class="b s150" href="{{ tag.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ tag.name }} ({{ parts_string }})</a><br>
- {%- for inner in tag.pages | sort(attribute="date") %}
- {%- if inner.content == page.content %}
- <a class="scur" href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
- {%- set_global current_section_index = loop.index0 %} {# Finds the current section, needed for pagination logic later #}
- {% else %}
- <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
- {%- endif %}
- {%- endfor %}
+ <div class="block">
+ <div class="blockdiv">
+ <a class="b s150" href="{{ tag.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ tag.name }} ({{ parts_string }})</a><br>
+ {%- for inner in tag.pages | sort(attribute="date") %}
+ {%- if inner.content == page.content %}
+ <a class="scur" href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
+ {%- set_global current_section_index = loop.index0 %} {# Finds the current section, needed for pagination logic later #}
+ {%- else %}
+ <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
+ {%- endif %}
+ {%- endfor %}
+ </div>
</div>
- </div>
{%- endif %}
{%- endif %}
-
{{ page.content | safe }}
-
- {%- if config.extra.meta_post.position %}
- {%- if config.extra.meta_post.position == "bottom" or config.extra.meta_post.position == "both" %}
- {{- macros::meta_post(page=page, config=config) }}
+ {%- if config.extra.meta_post?.position %}
+ {%- if config.extra.meta_post?.position == "bottom" or config.extra.meta_post?.position == "both" %}
+ {{<meta_post page={page} config={config} />}}
{%- endif %}{%- endif %}
{%- block page_footer %}
- {{- macros::footer(page=page, config=config) }}
+ {{<footer page={page} config={config} />}}
{%- endblock page_footer %}
{%- block comments_body %}
- {%- if not config.extra.comment_system or config.extra.comment_system == "hyvor" %}
- {%- if config.extra.comments.hyvor %}
- <hyvor-talk-comments website-id={{ config.extra.comments.hyvor }} page-id={{ page.slug }}{%- if config.extra.comments.hyvorcolor %} colors="{{ config.extra.comments.hyvorcolor }}"{%- endif %}></hyvor-talk-comments>
- {%- endif %}
- {%- elif config.extra.comment_system == "remark42" and config.extra.comments.remark42 %}
+ {%- if config.extra.comment_system == "hyvor" and config.extra.comments?.hyvor %}
+ <hyvor-talk-comments website-id={{ config.extra.comments?.hyvor }} page-id={{ page.slug }}{%- if config.extra.comments?.hyvorcolor %} colors="{{ config.extra.comments?.hyvorcolor }}"{%- endif %}></hyvor-talk-comments>
+ {%- elif config.extra.comment_system == "remark42" and config.extra.comments?.remark42 %}
<div id="remark42"></div>
{%- endif %}
{%- endblock comments_body %}
@@ -113,77 +105,75 @@
{%- set toc = page.toc %}
{%- endif %}
{%- if toc or page.extra.series %}
-
<div class="sblock">
{%- if page.extra.series %}
{%- set num_extra_pages = config.extra.series_items | default(value=9) %}
<div class="blockdiv">
<a class="b s150" href="{{ tag.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ parts_string }}</a><br>
{%- if tag.page_count > num_extra_pages and num_extra_pages > 0 %}
- {%- set sorted_array = tag.pages | sort(attribute="date") %}
- {%- set num_pages = tag.page_count %}
-
- {# Shows the first page #}
- {{ macros::series_link(inner=sorted_array.0, page=page, config=config) }}
+ {%- set sorted_array = tag.pages | sort(attribute="date") -%}
+ {%- set num_pages = tag.page_count %}
+ {#- Shows the first page -#}
+ {{<series_link inner={sorted_array[0]} page={page} config={config} />}}
- {# Hides the next couple of pages if the current section is more than 3 away from start #}
- {%- if current_section_index > 3 %}
- <details>
- <summary>{{ macros::translate(key="more", default="more", i18n=i18n) | title }}...</summary>
- </details>
- <div class="hidden_li">
- {%- for inner in sorted_array | slice(start=1, end=(current_section_index - 2)) %}
- <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
- {%- endfor %}
- </div>
- {%- endif %}
+ {#- Hides the next couple of pages if the current section is more than 3 away from start #}
+ {%- if current_section_index > 3 %}
+ <details>
+ <summary>{% set _m %}{{<translate key="more" default="more" i18n={i18n} />}}{% endset %}{{ _m | title }}...</summary>
+ </details>
+ <div class="hidden_li">
+ {%- for inner in sorted_array[1:(current_section_index - 2)] %}
+ <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
+ {%- endfor %}
+ </div>
+ {%- endif %}
- {# Max(current_section_index - 2, 1) #}
+ {#- Max(current_section_index - 2, 1) #}
{%- if (current_section_index - 2 ) > 1 %}
{%- set num = current_section_index - 2 %}
{%- else %}
{%- set num = 1 %}
{%- endif %}
- {# Shows two pages before current page #}
- {%- for inner in sorted_array | slice(start=num, end=current_section_index) %}
- <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
+ {#- Shows two pages before current page #}
+ {%- for inner in sorted_array[num:current_section_index] %}
+ <a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
{%- endfor %}
- {# Shows the current page #}
+ {#- Shows the current page #}
{%- if current_section_index != 0 and current_section_index != (num_pages - 1) %}
- {{ macros::series_link(inner=sorted_array[current_section_index], page=page, config=config) }}
+ {{<series_link inner={sorted_array[current_section_index]} page={page} config={config} />}}
{%- endif %}
- {# Min(num_pages - 1, current_section_index + 3) #}
+ {#- Min(num_pages - 1, current_section_index + 3) #}
{%- if (num_pages - 2 ) < (current_section_index + 3) %}
{%- set num = num_pages - 1 %}
{%- else %}
{%- set num = current_section_index + 3 %}
{%- endif %}
- {%- for inner in sorted_array | slice(start=(current_section_index + 1), end=num ) %}
+ {%- for inner in sorted_array[(current_section_index + 1):num] %}
<a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
- {% endfor %}
+ {%- endfor %}
{%- if current_section_index < num_pages - 4 %}
<details>
- <summary>{{ macros::translate(key="more", default="more", i18n=i18n) | title }}...</summary>
+ <summary>{% set _m %}{{<translate key="more" default="more" i18n={i18n} />}}{% endset %}{{ _m | title }}...</summary>
</details>
<div class="hidden_li">
- {%- for inner in sorted_array | slice(start=(current_section_index + 3), end=(num_pages - 1)) %}
+ {%- for inner in sorted_array[(current_section_index + 3):(num_pages - 1)] %}
<a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ inner.title }}</a><br>
{%- endfor %}
</div>
{%- endif %}
- {%- set last = num_pages - 1%}
- {{ macros::series_link(inner=sorted_array[last], page=page, config=config) }}
+ {%- set last = num_pages - 1 -%}
+ {{<series_link inner={sorted_array[last]} page={page} config={config} />}}
- {# If there is not more than max pages render normally #}
+ {#- If there is not more than max pages render normally -#}
{%- else %}
{%- for inner in tag.pages | sort(attribute="date") %}
- {{ macros::series_link(inner=inner, page=page, config=config) }}
+ {{<series_link inner={inner} page={page} config={config} />}}
{%- endfor %}
{%- endif %}
</div>
@@ -191,7 +181,7 @@
{%- if toc %}
<div class="blockdiv sticky">
- <a class="b s150" href="#">{{ macros::translate(key="Index", default="Index", i18n=i18n) }}</a>
+ <a class="b s150" href="#">{{<translate key="Index" default="Index" i18n={i18n} />}}</a>
{%- for h in toc %}
<div>
<a href="#{{h.id | safe}}">{{ h.title }}</a>
diff --git a/templates/pages.html b/templates/pages.html
index 72f4071..6d316cb 100644
--- a/templates/pages.html
+++ b/templates/pages.html
@@ -6,34 +6,31 @@ Some people prefer a landing page for the index, and then use a separate paginat
{% extends "base.html" %}
-{%- block seo %}
- {{- super() }}
- {%- set title_addition = "" %}
-
- {%- if page.title and config.title %}
- {%- set title = page.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- elif section.title and config.title %}
- {%- set title = section.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- elif page.title %}
- {%- set title = page.title %}
- {%- elif section.title %}
- {%- set title = section.title %}
- {%- else %}
- {%- set title = config.title %}
- {%- endif %}
-
- {%- if page.description %}
- {%- set description = page.description %}
- {%- elif section.description %}
- {%- set description = section.description %}
- {%- else %}
- {%- set description = config.description %}
- {%- endif %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description) }}
-{%- endblock seo %}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title_addition = "" -%}
+ {%- if page.title and config.title -%}
+ {%- set title = page.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- elif section.title and config.title -%}
+ {%- set title = section.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- elif page.title -%}
+ {%- set title = page.title -%}
+ {%- elif section.title -%}
+ {%- set title = section.title -%}
+ {%- else -%}
+ {%- set title = config.title -%}
+ {%- endif -%}
+ {%- if page.description -%}
+ {%- set description = page.description -%}
+ {%- elif section and section.description -%}
+ {%- set description = section.description -%}
+ {%- else -%}
+ {%- set description = config.description -%}
+ {%- endif -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} />}}
+{%- endblock seo -%}
{%- block content %}
<div>
diff --git a/templates/partials/head.html b/templates/partials/head.html
index 668b811..e020404 100644
--- a/templates/partials/head.html
+++ b/templates/partials/head.html
@@ -21,7 +21,7 @@
<link rel="stylesheet" href="{{ get_url(path=i , trailing_slash=false, cachebust=true) | safe }}" />
{%- endfor %}{%- endif %}
- {%- if page.extra.stylesheets %}{%- set pagestylesheets=page.extra.stylesheets -%}{%- endif %}
+ {%- if page?.extra?.stylesheets %}{%- set pagestylesheets=page?.extra?.stylesheets -%}{%- endif %}
{%- if pagestylesheets %}{%- for i in pagestylesheets %}
<link rel="stylesheet" href="{{ get_url(path=i , trailing_slash=false, cachebust=true) | safe }}" />
{%- endfor %}{%- endif %}
@@ -98,7 +98,7 @@
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set integrity = false %}{% endif %}{% endif %}
{%- if config.extra.fonts %}{%- for i in config.extra.fonts %}
- {%- if i.url is matching("^http[s]?://") %}
+ {%- if i.url is matching(pat="^http[s]?://") %}
<link rel="preload" as="style" class="preStyle" href="{{ i.url | safe }}" crossorigin="anonymous" />
{%- else %}
<link rel="preload" as="font" href="{{ get_url(path=i.url, trailing_slash=false) | safe }}" type="font/woff2" />
@@ -109,10 +109,10 @@
<link rel="preload" as="style" class="preStyle" href="{{ config.extra.fontawesome | safe }}" crossorigin="anonymous" />
{%- endif %}
-{%- if config.extra.math or page.extra.math %}
+{%- if config.extra.math or page?.extra?.math %}
{%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%}
- {%- if katex_css %}{%- if katex_css is matching("^http[s]?://") %}
+ {%- if katex_css %}{%- if katex_css is matching(pat="^http[s]?://") %}
<link rel="preload" as="style" class="preStyle" href="{{ katex_css | safe }}"{%- if integrity and config.extra.katex_css_integrity %} integrity="{{ config.extra.katex_css_integrity | safe }}"{%- endif %} crossorigin="anonymous" />
{%- else %}
<link rel="preload" as="style" class="preStyle" href="{{ get_url(path=katex_css, trailing_slash=false) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=katex_css, sha_type=384, base64=true) | safe }}"{%- endif %} />
@@ -124,31 +124,19 @@
-{#- Rss / Atom Feed #}
-
- {%- if config.generate_feeds %}
- {%- for feed in config.feed_filenames %}
-
- {%- if feed is containing('atom') %}
+{#- Rss / Atom Feed -#}
+{%- if config.generate_feeds -%}
+{%- for feed in config.feed_filenames -%}
+{%- if feed is containing(pat='atom') %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
- {%- endif %}
-
- {%- if feed is containing('rss') %}
+{%- endif -%}
+{%- if feed is containing(pat='rss') %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
- {%- endif %}
-
- {%- endfor %}
- {%- endif %}
-
-
-
-
-
-{#- Extra items #}
- {%- if config.extra.head_extra %}
+{%- endif -%}
+{%- endfor -%}
+{%- endif -%}
+{#- Extra items -#}
+{%- if config.extra.head_extra %}
{{ config.extra.head_extra | safe }}
- {%- endif %}
-
-
-
+{%- endif -%}
{#- End of head partial -#}
diff --git a/templates/partials/head_js.html b/templates/partials/head_js.html
index 2a16b6d..af82de8 100644
--- a/templates/partials/head_js.html
+++ b/templates/partials/head_js.html
@@ -1,36 +1,36 @@
-{#- JAVASCRIPT #}
+{#- JAVASCRIPT -#}
{%- set integrity = config.extra.integrity | default(value=true) -%}
- {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set integrity = false %}{% endif %}{% endif %}
+ {%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{%- set integrity = false -%}{%- endif -%}{%- endif -%}
{%- set search_library=config.extra.search_library | default(value="elasticlunr") -%}
- {%- set preStyle = false %}
+ {%- set preStyle = false -%}
- {%- if config.extra.fonts %}{%- for i in config.extra.fonts %}
- {%- if i.url is matching("^http[s]?://") %}
- {%- set preStyle = true %}
- {%- endif %}
- {%- endfor %}{%- endif %}
+ {%- if config.extra.fonts -%}{%- for i in config.extra.fonts -%}
+ {%- if i.url is matching(pat="^http[s]?://") -%}
+ {%- set preStyle = true -%}
+ {%- endif -%}
+ {%- endfor -%}{%- endif -%}
- {%- if config.extra.fontawesome %}
- {%- set preStyle = true %}
- {%- endif %}
+ {%- if config.extra.fontawesome -%}
+ {%- set preStyle = true -%}
+ {%- endif -%}
- {%- if config.extra.math or page.extra.math %}
+ {%- if config.extra.math or page?.extra?.math -%}
{%- set katex_css=config.extra.katex_css | default(value="katex.min.css") -%}
- {%- if katex_css %}
- {%- set preStyle = true %}
- {%- endif %}
- {%- endif %}
+ {%- if katex_css -%}
+ {%- set preStyle = true -%}
+ {%- endif -%}
+ {%- endif -%}
-{%- if config.mode != "serve" -%}{%- set notserve = true %}{%- endif %}
-{%- if config.extra.js_bundle %}
+{%- if config.mode != "serve" -%}{%- set notserve = true -%}{%- endif -%}
+{%- if config.extra.js_bundle -%}
- {%- if config.build_search_index %}
+ {%- if config.build_search_index -%}
{%- if notserve and config.extra.pwa | default(value=false) %}
<script defer src="{{ get_url(path='js/abridge.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/abridge.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- else %}
<script defer src="{{ get_url(path='js/abridge_nopwa.min.js' , trailing_slash=false, cachebust=true) | safe }}"{%- if integrity %} integrity="sha384-{{ get_hash(path='js/abridge_nopwa.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
- {%- endif %}
+ {%- endif -%}
{%- else %}
{%- if notserve and config.extra.pwa | default(value=false) %}
@@ -117,7 +117,7 @@
{#- https://katex.org/docs/autorender.html #}
{#- https://github.com/KaTeX/KaTeX/ #}
{#- https://github.com/KaTeX/KaTeX/tree/main/contrib/mathtex-script-type/ #}
-{%- if config.extra.math or page.extra.math %}
+{%- if config.extra.math or page?.extra?.math %}
{%- set katex_bundle=config.extra.katex_bundle | default(value="js/katexbundle.min.js") -%}
{%- if katex_bundle %}
@@ -125,23 +125,23 @@
{%- else %}
{%- set katex_js=config.extra.katex_js | default(value="js/katex.min.js") -%}
- {%- if katex_js %}{%- if katex_js is matching("^http[s]?://") %}
+ {%- if katex_js %}{%- if katex_js is matching(pat="^http[s]?://") %}
<script defer src="{{ katex_js | safe }}"{%- if integrity and config.extra.katex_js_integrity %} integrity="{{ config.extra.katex_js_integrity | safe }}"{%- endif %} crossorigin="anonymous"></script>
{%- else %}
<script defer src="{{ get_url(path=katex_js , trailing_slash=false, cachebust=true) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=katex_js, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}{%- endif %}
{%- set mathtex_js=config.extra.mathtex_js | default(value="js/mathtex-script-type.min.js") -%}
- {%- if mathtex_js %}{%- if mathtex_js is matching("^http[s]?://") %}
+ {%- if mathtex_js %}{%- if mathtex_js is matching(pat="^http[s]?://") %}
<script defer src="{{ mathtex_js | safe }}"{%- if integrity and config.extra.mathtex_js_integrity %} integrity="{{ config.extra.mathtex_js_integrity | safe }}"{%- endif %} crossorigin="anonymous"></script>
{%- else %}
<script defer src="{{ get_url(path=mathtex_js , trailing_slash=false, cachebust=true) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=mathtex_js, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}{%- endif %}
- {%- if config.extra.math_auto_render or page.extra.math_auto_render %}
+ {%- if config.extra.math_auto_render or page?.extra?.math_auto_render %}
{%- set katex_autorender_js=config.extra.katex_autorender_js | default(value="js/katex-auto-render.min.js") -%}
{%- if katex_autorender_js %}
- {%- if katex_autorender_js is matching("^http[s]?://") %}
+ {%- if katex_autorender_js is matching(pat="^http[s]?://") %}
<script defer src="{{ katex_autorender_js | safe }}"{%- if integrity and config.extra.katex_autorender_js_integrity %} integrity="{{ config.extra.katex_autorender_js_integrity | safe }}"{%- endif %} crossorigin="anonymous"></script>
{%- else %}
<script defer src="{{ get_url(path=katex_autorender_js , trailing_slash=false, cachebust=true) }}"{%- if integrity %} integrity="sha384-{{ get_hash(path=katex_autorender_js, sha_type=384, base64=true) | safe }}"{%- endif %}></script>
@@ -161,4 +161,4 @@
-{#- End of head_js partial -#}
+{#- End of head_js partial #}
diff --git a/templates/partials/social.html b/templates/partials/social.html
index 73e8bb2..a44142a 100644
--- a/templates/partials/social.html
+++ b/templates/partials/social.html
@@ -3,9 +3,9 @@
{%- if config.generate_feeds and config.extra.feed -%}
{%- for feed in config.feed_filenames -%}
- {%- if feed is containing('atom') -%}
+ {%- if feed is containing(pat='atom') -%}
<a type="application/atom+xml" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" target="_blank" title="{{ config.title }} Atom Feed"><i type="Button" class="svg rss" title="{{ config.title }} Atom Feed"></i></a>{% endif -%}
- {%- if feed is containing('rss') -%}
+ {%- if feed is containing(pat='rss') -%}
<a type="application/rss+xml" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" target="_blank" title="{{ config.title }} RSS Feed"><i type="Button" class="svg rss" title="{{ config.title }} RSS Feed"></i></a>{% endif -%}
{%- endfor -%}
diff --git a/templates/shortcodes/audio.html b/templates/shortcodes/audio.html
deleted file mode 100644
index 2d6eda9..0000000
--- a/templates/shortcodes/audio.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%}
-<audio controls{% if class %} class="{{class}}"{% endif %}{% if autoplay %} autoplay{% endif %}{% if loop %} loop{% endif %}{% if muted %} muted{% endif %}{% if playsinline %} playsinline{% endif %}>
- {% for src in sources -%}
-
- {%- set file = src | split(pat="/") | last %}
- {%- set dirtest = src | trim_start_matches(pat="./") %}
- {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %}
- {%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %}
-
- {%- if src is starting_with("./") and reldir %}{# Relative Path #}
- {%- set path = src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
- {%- set path = path ~ "/" %}
-
- {%- elif src is starting_with("/") %}{# Root Path #}
- {%- set rootpath = src | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {%- set path = config.base_url ~ rootpath ~ "/" %}
-
- {%- else %}{# Same Directory Path #}
- {%- set path = "" %}
-
- {%- endif %}
-
- {%- set type = src | split(pat=".") | last -%}
- {%- if type is matching("^mov$") %}{% set type = "quicktime" %}{% endif -%}
- <source src="{{ path | safe }}{{ file | safe }}" type="{{ 'audio/' ~ type }}" />
- {% endfor -%}
- Your browser doesn't support the audio tag and/or the audio formats in use here – sorry!
-</audio>
-{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif -%}
diff --git a/templates/shortcodes/gif.html b/templates/shortcodes/gif.html
deleted file mode 100644
index 430ba89..0000000
--- a/templates/shortcodes/gif.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%}
-<video controls{% if class %} class="{{class}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} autoplay loop muted playsinline>
- {% for src in sources -%}
-
- {%- set video = src | split(pat="/") | last %}
- {%- set dirtest = src | trim_start_matches(pat="./") %}
- {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %}
- {%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %}
-
- {%- if src is starting_with("./") and reldir %}{# Relative Path #}
- {%- set path = src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
- {%- set path = path ~ "/" %}
-
- {%- elif src is starting_with("/") %}{# Root Path #}
- {%- set rootpath = src | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {%- set path = config.base_url ~ rootpath ~ "/" %}
-
- {%- else %}{# Same Directory Path #}
- {%- set path = "" %}
-
- {%- endif %}
-
- {%- set type = src | split(pat=".") | last -%}
- {%- if type is matching("^mov$") %}{% set type = "quicktime" %}{% endif -%}
- <source src="{{ path | safe }}{{ video | safe }}" type="{{ 'video/' ~ type }}" />
- {% endfor -%}
- Your browser doesn't support the video tag and/or the video formats in use here – sorry!
-</video>
-{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif -%}
diff --git a/templates/shortcodes/katex.html b/templates/shortcodes/katex.html
deleted file mode 100644
index 9b9a1f7..0000000
--- a/templates/shortcodes/katex.html
+++ /dev/null
@@ -1 +0,0 @@
-<script type="math/tex{% if block %};mode=display{% endif %}">{{body | safe}}</script>
diff --git a/templates/shortcodes/showdata.html b/templates/shortcodes/showdata.html
deleted file mode 100644
index 7f3d3bc..0000000
--- a/templates/shortcodes/showdata.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{# showdata(src="../theme.toml" type="toml" key="min_version") #}
-
-{%- if src and key and type %}
- {%- if src is matching("^http[s]?://") %}
- {% set data = load_data(url=src, format=type) %}
- {%- else %}
- {% set data = load_data(path=src, format=type) %}
- {%- endif %}
- {{ data[key] }}
-{%- else %}
- {# Load other file types as plain text #}
- {%- if src is matching("^http[s]?://") %}
- {% set data = load_data(url=src) %}
- {%- else %}
- {% set data = load_data(path=src) %}
- {%- endif %}
- {{ data }}
-{%- endif %}
diff --git a/templates/shortcodes/video.html b/templates/shortcodes/video.html
deleted file mode 100644
index 9d33f28..0000000
--- a/templates/shortcodes/video.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{%- if caption %}<figure class="fi{% if class %} {{class}}{% endif %}">{% endif -%}
-<video controls{% if class %} class="{{class}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %}{% if autoplay %} autoplay{% endif %}{% if loop %} loop{% endif %}{% if muted %} muted{% endif %}{% if playsinline %} playsinline{% endif %}>
- {% for src in sources -%}
-
- {%- set video = src | split(pat="/") | last %}
- {%- set dirtest = src | trim_start_matches(pat="./") %}
- {%- if dirtest is containing("/") %} {%- set reldir = true %} {%- endif %}
- {%- if page.path %}{%- set pagepath = page.path %}{%- elif section.path %}{%- set pagepath = section.path %}{%- endif %}
-
- {%- if src is starting_with("./") and reldir %}{# Relative Path #}
- {%- set path = src | trim_start_matches(pat="./") | split(pat="/") | slice(end=-1) | join(sep="/") | trim_start_matches(pat="/") %}
- {%- set path = path ~ "/" %}
-
- {%- elif src is starting_with("/") %}{# Root Path #}
- {%- set rootpath = src | split(pat="/") | slice(end=-1) | join(sep="/") %}
- {%- set path = config.base_url ~ rootpath ~ "/" %}
-
- {%- else %}{# Same Directory Path #}
- {%- set path = "" %}
-
- {%- endif %}
-
- {%- set type = src | split(pat=".") | last -%}
- {%- if type is matching("^mov$") %}{% set type = "quicktime" %}{% endif -%}
- <source src="{{ path | safe }}{{ video | safe }}" type="{{ 'video/' ~ type }}" />
- {% endfor -%}
- Your browser doesn't support the video tag and/or the video formats in use here – sorry!
-</video>
-{%- if caption %}<figcaption>{{caption}}</figcaption></figure>{% endif -%}
diff --git a/templates/tags/list.html b/templates/tags/list.html
index 901beea..0f3488a 100644
--- a/templates/tags/list.html
+++ b/templates/tags/list.html
@@ -1,26 +1,21 @@
-{% extends "base.html" %}
+{%- extends "base.html" -%}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-
-{%- block seo %}
- {{- super() }}
- {%- set title = "Tags" %}
-
- {%- if config.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
-
+{%- if config.extra.search_library -%}{%- if config.extra.search_library == "offline" -%}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title = "Tags" -%}
+ {%- if config.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} is_home={true} />}}
+{%- endblock seo -%}
{%- block content %}
<div>
<div class="c">
- <h1>{{ terms | length }} {{ macros::translate(key="Tags", default="Tags", i18n=i18n) }} </h1>
+ <h1>{{ terms | length }} {{<translate key="Tags" default="Tags" i18n={i18n} />}} </h1>
<p>{% for term in terms %} #<a href="#{{ term.name }}">{{ term.name }}</a><sup>{{ term.pages | length }}</sup> {% endfor %}</p>
</div>
{%- for term in terms %}
diff --git a/templates/tags/single.html b/templates/tags/single.html
index eb1d77a..b507ceb 100644
--- a/templates/tags/single.html
+++ b/templates/tags/single.html
@@ -1,22 +1,17 @@
-{% extends "base.html" %}
+{%- extends "base.html" -%}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-
-{%- block seo %}
- {{- super() }}
- {%- set title = term.name ~ " tag" %}
-
- {%- if config.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
-
+{%- if config.extra.search_library -%}{%- if config.extra.search_library == "offline" -%}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title = term.name ~ " tag" -%}
+ {%- if config.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{<seo config={config} title={title} title_addition={title_addition} description={description or ""} is_home={true} />}}
+{%- endblock seo -%}
{%- block content %}
<div>
<h2>{{ term.name }}</h2>
diff --git a/theme.toml b/theme.toml
index b879469..2340f7f 100644
--- a/theme.toml
+++ b/theme.toml
@@ -2,7 +2,7 @@ name = "abridge"
description = "A fast and lightweight Zola theme using semantic html, a class-light abridge.css, and No mandatory JS."
license = "MIT"
homepage = "https://github.com/jieiku/abridge"
-min_version = "0.19.1"
+min_version = "0.23.3"
demo = "https://abridge.pages.dev/"
# Abridge theme author info
diff --git a/config.toml b/zola.toml
index ea831a1..52e4625 100644
--- a/config.toml
+++ b/zola.toml
@@ -43,7 +43,9 @@ external_links_no_referrer = false # rel="noreferrer"
smart_punctuation = false # `...` to `…`, `"quote"` to `“curly”` etc
[markdown.highlighting]
-theme = "synthwave-84"
+theme = "plastic" #The plastic syntax theme is lightweight, but the colors are defined in abridge _colors-syntax.scss (not really the plastic theme, and you can change the colors to whatever you want)
+error_on_missing_language = true
+style = "class"
# Any Extra language you do not use, delete or comment out the extra language sections:
[languages.fr]