From 33947ae86119fa9f526f83c5272664defe80cc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 9 Jul 2022 10:37:39 +0200 Subject: [PATCH] theme: allow overriding partials for output formats #308 --- .../content/basics/customization/_index.en.md | 10 +- .../content/cont/archetypes/_index.en.md | 6 +- layouts/partials/_main.html | 10 +- layouts/partials/archetype.html | 15 +-- layouts/partials/article.html | 4 +- layouts/partials/body.html | 4 +- layouts/partials/body.print.html | 102 +----------------- layouts/partials/footer.html | 6 +- layouts/partials/header.html | 2 +- layouts/partials/initial.html | 8 +- layouts/partials/nestedArticle.html | 99 +++++++++++++++++ layouts/partials/output-partial.html | 10 ++ layouts/partials/page-meta.hugo | 6 +- layouts/partials/shortcodes/math.html | 2 +- layouts/partials/shortcodes/mermaid.html | 2 +- layouts/partials/shortcodes/swagger.html | 2 +- 16 files changed, 154 insertions(+), 134 deletions(-) create mode 100644 layouts/partials/nestedArticle.html create mode 100644 layouts/partials/output-partial.html diff --git a/exampleSite/content/basics/customization/_index.en.md b/exampleSite/content/basics/customization/_index.en.md index 14113a1927..165b527906 100644 --- a/exampleSite/content/basics/customization/_index.en.md +++ b/exampleSite/content/basics/customization/_index.en.md @@ -9,8 +9,10 @@ In `themes/hugo-theme-relearn/layouts/partials/`, you will find all the partials This theme defines the following partials : -- `header.html`: the header of the page. _Not meant to be overwritten_ -- `footer.html`: the footer of the page._Not meant to be overwritten_ +- `header.html`: the header of the page. See [output-formats](#output-formats) +- `footer.html`: the footer of the page. See [output-formats](#output-formats) +- `body.html`: the body of the page. The body may contain of one or many articles. See [output-formats](#output-formats) +- `article.html`: the output for a single article, can contain elements around your content. See [output-formats](#output-formats) - `menu.html`: left menu. _Not meant to be overwritten_ - `search.html`: search box. _Not meant to be overwritten_ - `custom-header.html`: custom headers in page. Meant to be overwritten when adding CSS imports. Don't forget to include `style` HTML tag directive in your file. @@ -81,3 +83,7 @@ If you want to switch the syntax highlightning theme together with your color va ### Roll your own If you are not happy with the shipped variants you can either copy one of the shipped files, edit them in a text editor and configure the `themeVariant` parameter in your `config.toml` or just use the [interactive variant generator]({{%relref "basics/generator" %}}). + +### Output formats + +Certain parts of the theme can be changed for support of your own [output formats](https://gohugo.io/templates/output-formats/). Eg. if you define a new output format `PLAINTEXT` in your `config.toml`, you can add a file `layouts/partials/header.plaintext.html` to change the way, the page header should look like for that output format. diff --git a/exampleSite/content/cont/archetypes/_index.en.md b/exampleSite/content/cont/archetypes/_index.en.md index 4fef32e448..0e8c76a4ad 100644 --- a/exampleSite/content/cont/archetypes/_index.en.md +++ b/exampleSite/content/cont/archetypes/_index.en.md @@ -115,7 +115,7 @@ To define how your archetypes are rendered, define corresponding partial files i If you use an unknown archetype in your frontmatter, the `default` archetype will be used to generate the page. -Related to each archetype, several _hook_ partial files can be given. If a partial for a specific hook is missing, no output is generated for this hook. +Related to each archetype, several _hook_ partial files in the form of `.html` can be given inside each archetype directory. If a partial for a specific hook is missing, no output is generated for this hook. The following hooks are used: @@ -125,3 +125,7 @@ The following hooks are used: | article | Defines the HTML how to render your content | Take a look at the existing archetypes of this theme to get an idea how to utilize it. + +#### Output formats + +Each hook file can be overridden of a specific [output format](https://gohugo.io/templates/output-formats/). Eg. if you define a new output format `PLAINTEXT` in your `config.toml`, you can add a file `layouts/partials/archetypes/default.plaintext.html` to change the way how normal content is written for that output format. diff --git a/layouts/partials/_main.html b/layouts/partials/_main.html index 08a7d99658..ef5c435cc5 100644 --- a/layouts/partials/_main.html +++ b/layouts/partials/_main.html @@ -1,9 +1,7 @@ -{{- partial "header.html" . }} +{{- partial "output-partial.html" (dict "base" "header" "page" . "parameter" .) }} {{- if not .File }} - {{- partial "initial.html" . }} -{{- else if eq (.Scratch.Get "relearnOutputFormat") "PRINT" }} - {{- partial "body.print.html" . }} + {{- partial "output-partial.html" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "initial.html" .))) }} {{- else }} - {{- partial "body.html" . }} + {{- partial "output-partial.html" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "content.html" .))) }} {{- end }} -{{- partial "footer.html" . }} \ No newline at end of file +{{- partial "output-partial.html" (dict "base" "footer" "page" . "parameter" .) }} \ No newline at end of file diff --git a/layouts/partials/archetype.html b/layouts/partials/archetype.html index a2d6e07e32..f89770ba60 100644 --- a/layouts/partials/archetype.html +++ b/layouts/partials/archetype.html @@ -1,14 +1,15 @@ +{{- $hook := .hook }} +{{- $page := .page }} +{{- $parameter := .parameter }} {{- $archetype := "default" }} -{{- if .page.Params.archetype }} - {{- $archetype = .page.Params.archetype }} -{{- else if .page.Params.chapter }} +{{- if $page.Params.archetype }} + {{- $archetype = $page.Params.archetype }} +{{- else if $page.Params.chapter }} {{- $archetype = "deprecated-chapter" }} -{{- else if .page.IsHome }} +{{- else if $page.IsHome }} {{- $archetype = "deprecated-home" }} {{- end }} {{- if not (fileExists (printf "/layouts/partials/archetypes/%s" $archetype)) }} {{- $archetype = "default" }} {{- end }} -{{- if (fileExists (printf "/layouts/partials/archetypes/%s/%s.html" $archetype .hook)) }} - {{- partial (printf "archetypes/%s/%s.html" $archetype .hook) . }} -{{- end }} \ No newline at end of file +{{- partial "output-partial.html" (dict "base" (printf "archetypes/%s/%s" $archetype $hook) "page" $page "parameter" $parameter) }} \ No newline at end of file diff --git a/layouts/partials/article.html b/layouts/partials/article.html index c267cf5627..13d4d4d132 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -1 +1,3 @@ -{{- partial "archetype.html" (dict "hook" "article" "page" .page "content" .content) }} \ No newline at end of file +{{- $page := .page }} +{{- $content := .content }} +{{- partial "archetype.html" (dict "hook" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }} \ No newline at end of file diff --git a/layouts/partials/body.html b/layouts/partials/body.html index a92573d683..121f729b21 100644 --- a/layouts/partials/body.html +++ b/layouts/partials/body.html @@ -1 +1,3 @@ -{{- partial "article.html" (dict "page" . "content" .Content) }} \ No newline at end of file +{{- $page := .page }} +{{- $content := .content }} +{{- partial "output-partial.html" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }} \ No newline at end of file diff --git a/layouts/partials/body.print.html b/layouts/partials/body.print.html index 00a0c33ead..fe2147b8ea 100644 --- a/layouts/partials/body.print.html +++ b/layouts/partials/body.print.html @@ -1,99 +1,3 @@ -{{- $currentNode := . }} -{{- $isActive := .IsHome }} -{{- $isShortcut := false }} -{{- $r_url := .RelPermalink }} -{{- with .Site.Menus.shortcuts }} - {{- range sort . "Weight" }} - {{- $s_url := .URL | relLangURL }} - {{- if (eq $s_url $r_url) }} - {{- $isShortcut = true }} - {{- end }} - {{- end }} -{{- end }} -{{- $pages := .Site.Home.Sections }} -{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} -{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }} -{{- if $isShortcut }} - {{- template "section-print" dict "sect" . "currentnode" $currentNode }} -{{- else }} - {{- if $isActive }} - {{- template "section-print" dict "sect" . "currentnode" $currentNode }} - {{- if or $pages }} -
- {{- end }} - {{- end }} - {{- if eq $currentOrdersectionsby "title" }} - {{- range $pages.ByTitle }} - {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} - {{- end }} - {{- else }} - {{- range $pages.ByWeight }} - {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} - {{- end }} - {{- end }} - {{- if $isActive }} - {{- if $pages }} -
- {{- end }} - {{- end }} -{{- end }} -{{- define "section-tree-print" }} - {{- $currentNode := .currentnode }} - {{- $isActive := .isActive }} - {{- $currentFileRelPermalink := .currentnode.RelPermalink }} - {{- with .sect }} - {{- $isSelf := eq .RelPermalink $currentFileRelPermalink }} - {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} - {{- $isActive = or $isSelf $isActive }} - {{- $pages := .Pages }} - {{- if .Page.IsHome }} - {{- $pages = .Sections }} - {{- else if .Page.Sections}} - {{- $pages = (.Pages | union .Sections) }} - {{- end }} - {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} - {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} - {{- if $hidden }} - {{- else if or .IsSection .IsHome }} - {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} - {{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }} - {{- if $isActive }} - {{- template "section-print" dict "sect" . "currentnode" $currentNode }} - {{- if $pages }} -
- {{- end }} - {{- end }} - {{- if eq $currentOrdersectionsby "title" }} - {{- range $pages.ByTitle }} - {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} - {{- end }} - {{- else }} - {{- range $pages.ByWeight }} - {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} - {{- end }} - {{- end }} - {{- if $isActive }} - {{- if $pages }} -
- {{- end }} - {{- end }} - {{- else }} - {{- if $isActive }} - {{- template "section-print" dict "sect" . "currentnode" $currentNode }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} -{{- define "section-print" }} - {{- $currentNode := .currentnode }} - {{- with .sect }} - {{- $currentNode.Page.Store.Set "printHasMathJax" (or ($currentNode.Page.Store.Get "printHasMathJax") (.Page.Store.Get "htmlHasMathJax")) }} - {{- $currentNode.Page.Store.Set "printHasMermaid" (or ($currentNode.Page.Store.Get "printHasMermaid") (.Page.Store.Get "htmlHasMermaid")) }} - {{- $currentNode.Page.Store.Set "printHasSwagger" (or ($currentNode.Page.Store.Get "printHasSwagger") (.Page.Store.Get "htmlHasSwagger")) }} - {{/* if we have a relative link in a print page, our print URL is one level to deep; so we are making it absolute to our page by prepending the page's permalink */}} - {{- $link_prefix := strings.TrimRight "/" .Page.RelPermalink }} - {{- $content := partial "content.html" . }} - {{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }} - {{- partial "article.html" (dict "page" . "content" $content) }} - {{- end }} -{{- end }} \ No newline at end of file +{{- $page := .page }} +{{- $content := .content }} +{{- partial "nestedArticle.html" $page }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 1f994189cd..44844420b4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -7,7 +7,7 @@ -{{- $wantsMathJax := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasMathJax")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasMathJax")) }} +{{- $wantsMathJax := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "selfHasMathJax")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "nestedHasMathJax")) }} {{- if $wantsMathJax }} {{- if isset .Params "mathjaxinitialize" }} {{- $.Scratch.Set "mathJaxInitialize" .Params.mathJaxInitialize }} @@ -48,7 +48,7 @@ {{- end }} {{- end }} -{{- $wantsMermaid := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasMermaid")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasMermaid")) }} +{{- $wantsMermaid := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "selfHasMermaid")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "nestedHasMermaid")) }} {{- if $wantsMermaid }} {{- if isset .Params "custommermaidurl" }} @@ -78,7 +78,7 @@ useMermaid( JSON.parse({{ $.Scratch.Get "mermaidInitialize" }}) ); {{- end }} -{{- $wantsSwagger := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasSwagger")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasSwagger")) }} +{{- $wantsSwagger := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "selfHasSwagger")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "nestedHasSwagger")) }} {{- if $wantsSwagger }} {{- if isset .Params "customswaggerurl" }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index a9f6a7afd8..1682bd9c40 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -105,7 +105,7 @@ {{- end }} -
+
{{- partial "tags.html" . }} diff --git a/layouts/partials/initial.html b/layouts/partials/initial.html index d6c843ea87..d3751801cb 100644 --- a/layouts/partials/initial.html +++ b/layouts/partials/initial.html @@ -1,5 +1,3 @@ -
-

Create this Page

You need to create a file for this page. You can either @@ -7,8 +5,4 @@

  • create an _index.md, index.md or otherly named markdown file (depending on Hugo's bundle type) in content folder and fill it with Markdown content
  • create an index.html file in the static folder and fill the file with HTML content
  • -
- -
-
-
\ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/nestedArticle.html b/layouts/partials/nestedArticle.html new file mode 100644 index 0000000000..134e783180 --- /dev/null +++ b/layouts/partials/nestedArticle.html @@ -0,0 +1,99 @@ +{{- $currentNode := . }} +{{- $isActive := .IsHome }} +{{- $isShortcut := false }} +{{- $r_url := .RelPermalink }} +{{- with .Site.Menus.shortcuts }} + {{- range sort . "Weight" }} + {{- $s_url := .URL | relLangURL }} + {{- if (eq $s_url $r_url) }} + {{- $isShortcut = true }} + {{- end }} + {{- end }} +{{- end }} +{{- $pages := .Site.Home.Sections }} +{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} +{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }} +{{- if $isShortcut }} + {{- template "section-print" dict "sect" . "currentnode" $currentNode }} +{{- else }} + {{- if $isActive }} + {{- template "section-print" dict "sect" . "currentnode" $currentNode }} + {{- if or $pages }} +
+ {{- end }} + {{- end }} + {{- if eq $currentOrdersectionsby "title" }} + {{- range $pages.ByTitle }} + {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} + {{- end }} + {{- else }} + {{- range $pages.ByWeight }} + {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} + {{- end }} + {{- end }} + {{- if $isActive }} + {{- if $pages }} +
+ {{- end }} + {{- end }} +{{- end }} +{{- define "section-tree-print" }} + {{- $currentNode := .currentnode }} + {{- $isActive := .isActive }} + {{- $currentFileRelPermalink := .currentnode.RelPermalink }} + {{- with .sect }} + {{- $isSelf := eq .RelPermalink $currentFileRelPermalink }} + {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} + {{- $isActive = or $isSelf $isActive }} + {{- $pages := .Pages }} + {{- if .Page.IsHome }} + {{- $pages = .Sections }} + {{- else if .Page.Sections}} + {{- $pages = (.Pages | union .Sections) }} + {{- end }} + {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} + {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} + {{- if $hidden }} + {{- else if or .IsSection .IsHome }} + {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} + {{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }} + {{- if $isActive }} + {{- template "section-print" dict "sect" . "currentnode" $currentNode }} + {{- if $pages }} +
+ {{- end }} + {{- end }} + {{- if eq $currentOrdersectionsby "title" }} + {{- range $pages.ByTitle }} + {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} + {{- end }} + {{- else }} + {{- range $pages.ByWeight }} + {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "isActive" $isActive }} + {{- end }} + {{- end }} + {{- if $isActive }} + {{- if $pages }} +
+ {{- end }} + {{- end }} + {{- else }} + {{- if $isActive }} + {{- template "section-print" dict "sect" . "currentnode" $currentNode }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} +{{- define "section-print" }} + {{- $currentNode := .currentnode }} + {{- with .sect }} + {{- $currentNode.Page.Store.Set "nestedHasMathJax" (or ($currentNode.Page.Store.Get "nestedHasMathJax") (.Page.Store.Get "selfHasMathJax")) }} + {{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "selfHasMermaid")) }} + {{- $currentNode.Page.Store.Set "nestedHasSwagger" (or ($currentNode.Page.Store.Get "nestedHasSwagger") (.Page.Store.Get "selfHasSwagger")) }} + {{/* if we have a relative link in a print page, our print URL is one level to deep; so we are making it absolute to our page by prepending the page's permalink */}} + {{- $link_prefix := strings.TrimRight "/" .Page.RelPermalink }} + {{- $content := partial "content.html" . }} + {{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }} + {{- partial "output-partial.html" (dict "base" "article" "page" . "parameter" (dict "page" . "content" $content)) }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/layouts/partials/output-partial.html b/layouts/partials/output-partial.html new file mode 100644 index 0000000000..ae3f9d40bb --- /dev/null +++ b/layouts/partials/output-partial.html @@ -0,0 +1,10 @@ +{{- $base := .base }} +{{- $page := .page }} +{{- $parameter := .parameter }} +{{- if or (not ($page.Scratch.Get "relearnOutputFormat")) (not (fileExists (printf "/layouts/partials/%s.%s.html" $base (($page.Scratch.Get "relearnOutputFormat") | lower)))) }} + {{- if (fileExists (printf "/layouts/partials/%s.html" $base)) }} + {{- partial (printf "%s.html" $base) $parameter }} + {{- end }} +{{- else }} + {{- partial (printf "%s.%s.html" $base ((.page.Scratch.Get "relearnOutputFormat") | lower)) $parameter }} +{{- end }} \ No newline at end of file diff --git a/layouts/partials/page-meta.hugo b/layouts/partials/page-meta.hugo index a1b4cda81c..b3d01279fb 100644 --- a/layouts/partials/page-meta.hugo +++ b/layouts/partials/page-meta.hugo @@ -8,15 +8,15 @@ {{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }}{{/* the node is hidden from the current page */}} {{- $wantsMathjax := or (and (ne $currentNode.Params.disableMathjax nil) (not $currentNode.Params.disableMathjax)) (and (ne .Site.Params.disableMathjax nil) (not .Site.Params.disableMathjax)) }} {{- if $wantsMathjax }} - {{- $currentNode.Page.Store.Set "htmlHasMathjax" true }} + {{- $currentNode.Page.Store.Set "selfHasMathjax" true }} {{- end }} {{- $wantsMermaid := or (and (ne $currentNode.Params.disableMermaid nil) (not $currentNode.Params.disableMermaid)) (and (ne .Site.Params.disableMermaid nil) (not .Site.Params.disableMermaid)) }} {{- if $wantsMermaid }} - {{- $currentNode.Page.Store.Set "htmlHasMermaid" true }} + {{- $currentNode.Page.Store.Set "selfHasMermaid" true }} {{- end }} {{- $wantsSwagger := or (and (ne .Params.disableSwagger nil) (not .Params.disableSwagger)) (and (ne .Site.Params.disableSwagger nil) (not .Site.Params.disableSwagger)) }} {{- if $wantsSwagger }} - {{- $currentNode.Page.Store.Set "htmlHasSwagger" true }} + {{- $currentNode.Page.Store.Set "selfHasSwagger" true }} {{- end }} {{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" .Site.Params.ordersectionsby }} {{- define "relearn-structure" }} diff --git a/layouts/partials/shortcodes/math.html b/layouts/partials/shortcodes/math.html index 504f56921c..d7aa83f19c 100644 --- a/layouts/partials/shortcodes/math.html +++ b/layouts/partials/shortcodes/math.html @@ -5,5 +5,5 @@ {{- $content | safeHTML -}} -{{- .Page.Store.Set "htmlHasMathJax" true }} +{{- .Page.Store.Set "selfHasMathJax" true }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/shortcodes/mermaid.html b/layouts/partials/shortcodes/mermaid.html index c6483ace9c..63748e7686 100644 --- a/layouts/partials/shortcodes/mermaid.html +++ b/layouts/partials/shortcodes/mermaid.html @@ -5,5 +5,5 @@
{{- $content | safeHTML -}}
-{{- .Page.Store.Set "htmlHasMermaid" true }} +{{- .Page.Store.Set "selfHasMermaid" true }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/shortcodes/swagger.html b/layouts/partials/shortcodes/swagger.html index c135499935..d2653bde65 100644 --- a/layouts/partials/shortcodes/swagger.html +++ b/layouts/partials/shortcodes/swagger.html @@ -24,5 +24,5 @@ spec-url="{{ $src }}" sort-tags="true" > -{{- .Page.Store.Set "htmlHasSwagger" true }} +{{- .Page.Store.Set "selfHasSwagger" true }} {{- end }} \ No newline at end of file