From f5bde1f0fd49d7fca394a0a35f8fe8a84948ac9a Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 16 Sep 2024 22:48:21 +0200 Subject: [PATCH] Bump KaTeX to latest version 0.16.11 Signed-off-by: Andreas Deininger --- README.md | 8 ++++---- exampleSite/.gitignore | 3 ++- exampleSite/content/post/math-typesetting.md | 15 +++++++-------- exampleSite/layouts/.gitkeep | 0 exampleSite/layouts/partials/hooks/head-end.html | 3 +++ layouts/partials/math.html | 6 +++--- 6 files changed, 19 insertions(+), 16 deletions(-) delete mode 100644 exampleSite/layouts/.gitkeep create mode 100644 exampleSite/layouts/partials/hooks/head-end.html diff --git a/README.md b/README.md index a0c7926a..4f07742a 100644 --- a/README.md +++ b/README.md @@ -844,13 +844,13 @@ mkdir -p layouts/partials && cp themes/clarity/layouts/partials/math.html layout Then add the corresponding line as its [README](https://github.com/KaTeX/KaTeX/tree/master/contrib/mhchem) suggested (without the `+` sign): ```diff - + - + -+ ++ - ``` diff --git a/exampleSite/.gitignore b/exampleSite/.gitignore index 132a0908..e4b8c67d 100644 --- a/exampleSite/.gitignore +++ b/exampleSite/.gitignore @@ -1,2 +1,3 @@ public/ -resources/ \ No newline at end of file +resources/ +.hugo_build.lock \ No newline at end of file diff --git a/exampleSite/content/post/math-typesetting.md b/exampleSite/content/post/math-typesetting.md index 48fdc79f..242a3721 100644 --- a/exampleSite/content/post/math-typesetting.md +++ b/exampleSite/content/post/math-typesetting.md @@ -11,9 +11,8 @@ Mathematical notation in a Hugo project can be enabled by using third party Java In this example we will be using [KaTeX](https://katex.org/) -- Create a partial under `/layouts/partials/math.html` -- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. -- Include the partial in your templates like so: +- Create a partial under `/layouts/partials/hooks/head-end.html` +- Add these lines to the newly created partial: ```bash {{ if or .Params.math .Site.Params.math }} @@ -21,17 +20,17 @@ In this example we will be using [KaTeX](https://katex.org/) {{ end }} ``` -- To enable KaTex globally set the parameter `math` to `true` in a project's configuration -- To enable KaTex on a per page basis include the parameter `math: true` in content files +- To enable KaTeX globally set the parameter `math` to `true` in a project's configuration +- To enable KaTeX on a per page basis include the parameter `math: true` in content files **Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) {{< math.inline >}} {{ if or .Page.Params.math .Site.Params.math }} - - - + + + {{ end }} {{}} diff --git a/exampleSite/layouts/.gitkeep b/exampleSite/layouts/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/exampleSite/layouts/partials/hooks/head-end.html b/exampleSite/layouts/partials/hooks/head-end.html new file mode 100644 index 00000000..6af03480 --- /dev/null +++ b/exampleSite/layouts/partials/hooks/head-end.html @@ -0,0 +1,3 @@ +{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/math.html b/layouts/partials/math.html index 999766e8..427d25f8 100644 --- a/layouts/partials/math.html +++ b/layouts/partials/math.html @@ -1,3 +1,3 @@ - - - \ No newline at end of file + + + \ No newline at end of file