From 411b501ea97df2a49d2d09bc5c7f8c7cb70f0a07 Mon Sep 17 00:00:00 2001 From: Splitter Date: Sun, 28 Jan 2024 18:43:07 +0000 Subject: [PATCH] starters(blog): enable Hugo v0.122 native math passthrough by default --- .github/workflows/publish.yaml | 2 +- config/_default/hugo.yaml | 9 +++------ config/_default/menus.yaml | 4 +--- content/post/teach-courses/index.md | 24 ++++++++---------------- go.mod | 2 +- netlify.toml | 2 +- 6 files changed, 15 insertions(+), 28 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e58fb6e..100c574 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,7 +1,7 @@ name: Deploy website to GitHub Pages env: - WC_HUGO_VERSION: '0.119.0' + WC_HUGO_VERSION: '0.122.0' on: # Trigger the workflow every time you push to the `main` branch diff --git a/config/_default/hugo.yaml b/config/_default/hugo.yaml index a38bc58..c484c48 100644 --- a/config/_default/hugo.yaml +++ b/config/_default/hugo.yaml @@ -3,7 +3,7 @@ # Hugo Documentation: https://gohugo.io/getting-started/configuration/#all-configuration-settings # This file is formatted using YAML syntax - learn more at https://learnxinyminutes.com/docs/yaml/ -title: Creator's Blog (Hugo Theme) # Website name +title: "Creator's Blog (Hugo Theme)" # Website name baseURL: 'https://example.com/' # Website URL ############################ @@ -70,11 +70,6 @@ taxonomies: author: authors markup: _merge: deep - highlight: - codeFences: true - noHl: false - noClasses: false - lineNos: false related: threshold: 80 includeNewer: true @@ -88,3 +83,5 @@ security: _merge: deep sitemap: _merge: deep +minify: + _merge: deep diff --git a/config/_default/menus.yaml b/config/_default/menus.yaml index d9f5cb2..6c90818 100644 --- a/config/_default/menus.yaml +++ b/config/_default/menus.yaml @@ -1,7 +1,5 @@ # Navigation Links -# To link a homepage widget, specify the URL as a hash `#` followed by the filename of the - # desired widget in your `content/home/` folder. - # The weight parameter defines the order that the links will appear in. +# The weight parameter defines the order that the links will appear in. main: - name: Home diff --git a/content/post/teach-courses/index.md b/content/post/teach-courses/index.md index 3aab7d5..f1d1dd6 100644 --- a/content/post/teach-courses/index.md +++ b/content/post/teach-courses/index.md @@ -67,52 +67,44 @@ renders as ## Math -Hugo Blox Builder supports a Markdown extension for $\LaTeX$ math. You can enable this feature by toggling the `math` option in your `config/_default/params.yaml` file. +Hugo Blox Builder supports a Markdown extension for $\LaTeX$ math. Enable math by setting the `math: true` option in your page's front matter, or enable math for your entire site by toggling math in your `config/_default/params.yaml` file: -To render _inline_ or _block_ math, wrap your LaTeX math with `{{}}$...${{}}` or `{{}}$$...$${{}}`, respectively. +```yaml +features: + math: + enable: true +``` -{{% callout note %}} -We wrap the LaTeX math in the Hugo Blox _math_ shortcode to prevent Hugo rendering our math as Markdown. -{{% /callout %}} +To render _inline_ or _block_ math, wrap your LaTeX math with `$...$` or `$$...$$`, respectively. Example **math block**: ```latex -{{}} $$ \gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2} $$ -{{}} ``` renders as -{{< math >}} $$\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}$$ -{{< /math >}} -Example **inline math** `{{}}$\nabla F(\mathbf{x}_{n})${{}}` renders as {{< math >}}$\nabla F(\mathbf{x}_{n})${{< /math >}}. +Example **inline math** `$\nabla F(\mathbf{x}_{n})$` renders as $\nabla F(\mathbf{x}_{n})$. Example **multi-line math** using the math linebreak (`\\`): ```latex -{{}} $$f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\ 1-p_{0}^{*} & \text{if }k=0.\end{cases}$$ -{{}} ``` renders as -{{< math >}} - $$ f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\ 1-p_{0}^{*} & \text{if }k=0.\end{cases} $$ -{{< /math >}} - ## Code Hugo Blox Builder utilises Hugo's Markdown extension for highlighting code syntax. The code theme can be selected in the `config/_default/params.yaml` file. diff --git a/go.mod b/go.mod index 41be56a..abe004b 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.19 require ( github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-netlify v1.1.2-0.20231125204555-f431a4a2c705 - github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.1.2-0.20231229233433-b290b27077b8 + github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.2.1-0.20240128183758-3fb9b2e11ab0 ) diff --git a/netlify.toml b/netlify.toml index 6e5f6e7..9501eac 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" [build.environment] - HUGO_VERSION = "0.121.1" + HUGO_VERSION = "0.122.0" GO_VERSION = "1.21.5" NODE_VERSION = "21.1.0" HUGO_ENABLEGITINFO = "true"