Skip to content

Commit

Permalink
all: Updates required for v0.123.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Feb 3, 2024
1 parent 6150a60 commit 4353916
Show file tree
Hide file tree
Showing 40 changed files with 1,241 additions and 629 deletions.
28 changes: 17 additions & 11 deletions config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,50 @@ identifier = 'templates'
pageRef = '/templates/'

[[docs]]
name = 'Functions'
name = 'Render hooks'
weight = 60
identifier = 'render-hooks'
pageRef = '/render-hooks/'

[[docs]]
name = 'Functions'
weight = 70
identifier = 'functions'
pageRef = '/functions/'

[[docs]]
name = 'Methods'
weight = 70
weight = 80
identifier = 'methods'
pageRef = '/methods/'

[[docs]]
name = 'Quick reference'
weight = 80
weight = 90
identifier = 'quick-reference'
pageRef = '/quick-reference/'

[[docs]]
name = 'Variables'
weight = 85
weight = 100
identifier = 'variables'
pageRef = '/variables/'

[[docs]]
name = 'Hugo Modules'
weight = 90
weight = 110
identifier = 'modules'
pageRef = '/hugo-modules/'

[[docs]]
name = 'Hugo Pipes'
weight = 100
weight = 120
identifier = 'hugo-pipes'
pageRef = '/hugo-pipes/'

[[docs]]
name = 'CLI'
weight = 110
weight = 130
post = 'break'
identifier = 'commands'
pageRef = '/commands/'
Expand All @@ -77,25 +83,25 @@ pageRef = '/commands/'

[[docs]]
name = 'Troubleshooting'
weight = 120
weight = 140
identifier = 'troubleshooting'
pageRef = '/troubleshooting/'

[[docs]]
name = 'Developer tools'
weight = 130
weight = 150
identifier = 'developer-tools'
pageRef = '/tools/'

[[docs]]
name = 'Hosting and deployment'
weight = 140
weight = 160
identifier = 'hosting-and-deployment'
pageRef = '/hosting-and-deployment/'

[[docs]]
name = 'Contribute'
weight = 150
weight = 170
post = 'break'
identifier = 'contribute'
pageRef = '/contribute/'
Expand Down
16 changes: 8 additions & 8 deletions content/en/content-management/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ toc: true
aliases: [/content/build-options/]
---

Build options are stored in a reserved front matter object named `_build` with these defaults:
Build options are stored in a reserved front matter object named `build` with these defaults:

{{< code-toggle file=content/example/index.md fm=true >}}
[_build]
[build]
list = 'always'
publishResources = true
render = 'always'
Expand Down Expand Up @@ -85,7 +85,7 @@ Set the build options in front matter:

{{< code-toggle file=content/headless/index.md fm=true >}}
title = 'Headless page'
[_build]
[build]
list = 'never'
publishResources = false
render = 'never'
Expand Down Expand Up @@ -143,7 +143,7 @@ Set the build options in front matter, using the `cascade` keyword to "cascade"
{{< code-toggle file=content/headless/_index.md fm=true >}}
title = 'Headless section'
[[cascade]]
[cascade._build]
[cascade.build]
list = 'local'
publishResources = false
render = 'never'
Expand Down Expand Up @@ -201,10 +201,10 @@ Set the build options in front matter, using the `cascade` keyword to "cascade"

{{< code-toggle file=content/glossary/_index.md fm=true >}}
title = 'Glossary'
[_build]
[build]
render = 'always'
[[cascade]]
[cascade._build]
[cascade.build]
list = 'local'
publishResources = false
render = 'never'
Expand Down Expand Up @@ -247,7 +247,7 @@ Set the build options in front matter:

{{< code-toggle file=content/books/_index.md >}}
title = 'Books'
[_build]
[build]
render = 'never'
list = 'never'
{{< /code-toggle >}}
Expand Down Expand Up @@ -294,7 +294,7 @@ Set the build options in front matter, using the `cascade` keyword to "cascade"
{{< code-toggle file=content/internal/_index.md >}}
title = 'Internal'
[[cascade]]
[cascade._build]
[cascade.build]
render = 'never'
list = 'never'
[cascade._target]
Expand Down
10 changes: 6 additions & 4 deletions content/en/content-management/diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ Will be rendered as:

## Mermaid diagrams

Hugo currently does not provide default templates for Mermaid diagrams. But you can easily add your own. One way to do it would be to create `layouts/_default/_markup/render-codeblock-mermaid.html`:
Hugo does not provide a built-in template for Mermaid diagrams. Create your own using a [code block render hook]:

```go-html-template
[code block render hook]: /render-hooks/code-blocks

{{< code file=layouts/_default/_markup/render-codeblock-mermaid.html >}}
<pre class="mermaid">
{{- .Inner | safeHTML }}
</pre>
{{ .Page.Store.Set "hasMermaid" true }}
```
{{< /code >}}

And then include this snippet at the bottom of the content template (**Note**: below `.Content` as the render hook is not processed until `.Content` is executed):
And then include this snippet at the bottom of the content template:

```go-html-template
{{ if .Page.Store.Get "hasMermaid" }}
Expand Down
Loading

0 comments on commit 4353916

Please sign in to comment.