Add some partials to load and create a Bergamot widget.

I've set up some infrastructure to build and host a bergamot JS
file using Nix on static.danilafe.com.

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2023-11-29 22:29:14 -08:00
parent 2855675fa5
commit 5041c90ac0
4 changed files with 15 additions and 0 deletions

View File

@ -31,3 +31,7 @@ defaultContentLanguage = 'en'
[languages.en] [languages.en]
title = "Daniel's Blog" title = "Daniel's Blog"
languageCode = "en-us" languageCode = "en-us"
[params]
bergamotJsUrl = "https://static.danilafe.com/bergamot/bergamot.js"
katexExpressionJsUrl = "https://static.danilafe.com/katex-expression/katex-expression.esm.js"

View File

@ -0,0 +1,3 @@
<script src="{{ .Site.Params.bergamotJsUrl }}"></script>
{{ $style := resources.Get "scss/bergamot.scss" | resources.ToCSS | resources.Minify }}
<link rel="stylesheet" href="{{ $style.Permalink }}">

View File

@ -0,0 +1,7 @@
<div id="{{ .Get "id" }}"></div>
<script>
var app = Elm.Main.init({
node: document.getElementById('{{ .Get "id" }}'),
flags: { rules: '{{- strings.Trim .Inner " \n" -}}', query: '{{ .Get "query" }}' }
});
</script>

View File

@ -0,0 +1 @@
<script type="module" src="{{ .Site.Params.katexExpressionJsUrl }}"></script>