diff --git a/layouts/partials/nested-article.hugo b/layouts/partials/nested-article.hugo index a29fa28d19..c52315ddbb 100644 --- a/layouts/partials/nested-article.hugo +++ b/layouts/partials/nested-article.hugo @@ -93,11 +93,7 @@ {{- $outputFormat := .outputFormat }} {{- with .sect }} {{- $page := . }} - {{/* 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 "output-partial.hugo" (dict "base" "content" "page" . "parameter" $page "outputFormat" $outputFormat) }} - {{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }} - {{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content "outputFormat" $outputFormat) "outputFormat" $outputFormat) }} + {{- partialCached "nested-content.hugo" (dict "page" $page "outputFormat" $outputFormat) $page.RelPermalink "outputFormat" $outputFormat }} {{- $currentNode.Page.Store.Set "nestedHasMathJax" (or ($currentNode.Page.Store.Get "nestedHasMathJax") (.Page.Store.Get "hasMathJax")) }} {{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }} {{- $currentNode.Page.Store.Set "nestedHasSwagger" (or ($currentNode.Page.Store.Get "nestedHasSwagger") (.Page.Store.Get "hasSwagger")) }} diff --git a/layouts/partials/nested-content.hugo b/layouts/partials/nested-content.hugo new file mode 100644 index 0000000000..824e52386b --- /dev/null +++ b/layouts/partials/nested-content.hugo @@ -0,0 +1,7 @@ +{{- $page := .page }} +{{- $outputFormat := .outputFormat }} +{{- $c:=""}}{{/* 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 "output-partial.hugo" (dict "base" "content" "page" $page "parameter" $page "outputFormat" $outputFormat) }} +{{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }} +{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content "outputFormat" $outputFormat) "outputFormat" $outputFormat) }} \ No newline at end of file diff --git a/layouts/partials/shortcodes/expand.html b/layouts/partials/shortcodes/expand.html index cf0166e7f4..0143632a6f 100644 --- a/layouts/partials/shortcodes/expand.html +++ b/layouts/partials/shortcodes/expand.html @@ -10,7 +10,7 @@