mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
print: fix links of subsections #340
This commit is contained in:
parent
4a816885a7
commit
7c5586abab
1 changed files with 3 additions and 0 deletions
|
@ -94,7 +94,10 @@
|
|||
{{- $currentNode := .currentnode }}
|
||||
{{- 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) }}
|
||||
{{- $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)) }}
|
||||
{{- $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")) }}
|
||||
|
|
Loading…
Reference in a new issue