diff --git a/config.yaml b/config.yaml index 9e8c9285..2d81ba14 100644 --- a/config.yaml +++ b/config.yaml @@ -1,3 +1,10 @@ +# TODO: Consider renaming this file to "hugo.yaml" in accordance with +# recommendations since v0.109 of Hugo. + +# TODO: Consider splitting config into separate files in a "config/" +# directory hierarchy. See +# . + disableKinds: - taxonomy theme: @@ -6,6 +13,7 @@ params: colorScheme: auto # can be auto (browser setting), light, or dark images: - /images/logo.svg + math: true navColor: blue font: name: "Lato" @@ -13,3 +21,19 @@ params: plausible: dataDomain: null javaScript: "https://views.scientific-python.org/js/script.js" + +# Math equations. +markup: + goldmark: + extensions: + passthrough: + delimiters: + block: + - - \[ + - \] + - - $$ + - $$ + inline: + - - \( + - \) + enable: true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d079e0a3..4c52e488 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,9 +8,6 @@ {{ partial "css.html" . -}} - - {{ partial "head.html" . -}} - {{ if .IsTranslated }} {{ range .Translations }} @@ -20,6 +17,11 @@ {{ template "_internal/twitter_cards.html" . }} + + {{/* Math equation support. See . */}} + {{ if .Param "math" }} + {{ partialCached "math.html" . }} + {{ end }} {{ block "navbar" . }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html deleted file mode 100644 index a6a20082..00000000 --- a/layouts/partials/head.html +++ /dev/null @@ -1,14 +0,0 @@ -{{ if (findRE `(\$.*\$)|(\\\\\[.*\\\\\])|(\\\\\(.*\\\\\))` .Content) }} - - -{{ end }} - diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 00000000..99f5b3e3 --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,11 @@ +{{/* See . */}} + + +