mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: respect output format suffix #308
This commit is contained in:
parent
5f2e3fe6e7
commit
43600a39d7
31 changed files with 72 additions and 69 deletions
|
@ -41,7 +41,7 @@ runs:
|
||||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||||
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||||
run: |
|
run: |
|
||||||
echo "$MILESTONE" > layouts/partials/version.html
|
echo -n "$MILESTONE" > layouts/partials/version.txt
|
||||||
npx github-release-notes@0.17.1 changelog --generate --override --tags=all
|
npx github-release-notes@0.17.1 changelog --generate --override --tags=all
|
||||||
git add *
|
git add *
|
||||||
git commit --message "Ship tag $MILESTONE"
|
git commit --message "Ship tag $MILESTONE"
|
||||||
|
@ -71,7 +71,7 @@ runs:
|
||||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||||
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||||
run: |
|
run: |
|
||||||
echo "$MILESTONE+tip" > layouts/partials/version.html
|
echo -n "$MILESTONE+tip" > layouts/partials/version.txt
|
||||||
git add *
|
git add *
|
||||||
git commit --message "Mark non-release version"
|
git commit --message "Mark non-release version"
|
||||||
git push origin main
|
git push origin main
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{{- partial "_main.html" . }}
|
{{- partial "_main.hugo" . }}
|
|
@ -1,3 +1,4 @@
|
||||||
|
{{- partial "page-meta.hugo" . }}
|
||||||
{{- $pages := slice }}
|
{{- $pages := slice }}
|
||||||
{{- range .Site.Pages }}
|
{{- range .Site.Pages }}
|
||||||
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}
|
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{{- partial "_main.html" . }}
|
{{- partial "_main.hugo" . }}
|
|
@ -1,4 +1,3 @@
|
||||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
|
||||||
{{- partial "page-meta.hugo" . }}
|
{{- partial "page-meta.hugo" . }}
|
||||||
{{- $pages := .Page.Pages }}
|
{{- $pages := .Page.Pages }}
|
||||||
{{- if .Page.IsHome }}
|
{{- if .Page.IsHome }}
|
||||||
|
@ -10,6 +9,7 @@
|
||||||
{{- if ge $limit 0 -}}
|
{{- if ge $limit 0 -}}
|
||||||
{{- $pages = $pages | first $limit -}}
|
{{- $pages = $pages | first $limit -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
<channel>
|
<channel>
|
||||||
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{{- partial "_main.html" . }}
|
{{- partial "_main.hugo" . }}
|
|
@ -1,5 +1,5 @@
|
||||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
|
|
||||||
{{- partial "page-meta.hugo" . }}
|
{{- partial "page-meta.hugo" . }}
|
||||||
|
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||||
{{- range .Data.Pages }}
|
{{- range .Data.Pages }}
|
||||||
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }}
|
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
{{- partial "page-meta.hugo" . }}
|
|
||||||
{{- partial "output-partial.html" (dict "base" "header" "page" . "parameter" .) }}
|
|
||||||
{{- if not .File }}
|
|
||||||
{{- partial "output-partial.html" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "initial.html" .))) }}
|
|
||||||
{{- else }}
|
|
||||||
{{- partial "output-partial.html" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.html" (dict "base" "content" "page" . "parameter" .)))) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- partial "output-partial.html" (dict "base" "footer" "page" . "parameter" .) }}
|
|
8
layouts/partials/_main.hugo
Normal file
8
layouts/partials/_main.hugo
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{{- partial "page-meta.hugo" . }}
|
||||||
|
{{- partial "output-partial.hugo" (dict "base" "header" "page" . "parameter" .) }}
|
||||||
|
{{- if not .File }}
|
||||||
|
{{- partial "output-partial.hugo" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.hugo" (dict "base" "initial" "page" . "parameter" .)))) }}
|
||||||
|
{{- else }}
|
||||||
|
{{- partial "output-partial.hugo" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.hugo" (dict "base" "content" "page" . "parameter" .)))) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- partial "output-partial.hugo" (dict "base" "footer" "page" . "parameter" .) }}
|
|
@ -12,4 +12,4 @@
|
||||||
{{- if not (fileExists (printf "/layouts/partials/archetypes/%s" $archetype)) }}
|
{{- if not (fileExists (printf "/layouts/partials/archetypes/%s" $archetype)) }}
|
||||||
{{- $archetype = "default" }}
|
{{- $archetype = "default" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- partial "output-partial.html" (dict "base" (printf "archetypes/%s/%s" $archetype $hook) "page" $page "parameter" $parameter) }}
|
{{- partial "output-partial.hugo" (dict "base" (printf "archetypes/%s/%s" $archetype $hook) "page" $page "parameter" $parameter) }}
|
|
@ -1,3 +1,3 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
{{- partial "archetype.html" (dict "hook" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }}
|
{{- partial "archetype.hugo" (dict "hook" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }}
|
|
@ -1,3 +1,3 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
{{- partial "single-article.html" (dict "page" $page "content" $content) }}
|
{{- partial "single-article.hugo" (dict "page" $page "content" $content) }}
|
|
@ -1,3 +1,3 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
{{- partial "nested-article.html" (dict "page" $page) }}
|
{{- partial "nested-article.hugo" (dict "page" $page) }}
|
|
@ -7,7 +7,7 @@
|
||||||
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||||
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||||
<script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
<script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||||
{{- $wantsMathJax := or (.Page.Store.Get "hasMathJax") (and (.Page.Store.Get (printf "%sIsNested" ((partial "output-format.html" .Page) | lower))) (.Page.Store.Get "nestedHasMathJax")) }}
|
{{- $wantsMathJax := or (.Page.Store.Get "hasMathJax") (and (.Page.Store.Get (printf "%sIsNested" (partial "output-format.hugo" .Page))) (.Page.Store.Get "nestedHasMathJax")) }}
|
||||||
{{- if $wantsMathJax }}
|
{{- if $wantsMathJax }}
|
||||||
{{- if isset .Params "mathjaxinitialize" }}
|
{{- if isset .Params "mathjaxinitialize" }}
|
||||||
{{- $.Scratch.Set "mathJaxInitialize" .Params.mathJaxInitialize }}
|
{{- $.Scratch.Set "mathJaxInitialize" .Params.mathJaxInitialize }}
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<script id="MathJax-script" async src="{{"js/mathjax/tex-mml-chtml.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
<script id="MathJax-script" async src="{{"js/mathjax/tex-mml-chtml.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $wantsMermaid := or (.Page.Store.Get "hasMermaid") (and (.Page.Store.Get (printf "%sIsNested" ((partial "output-format.html" .Page) | lower))) (.Page.Store.Get "nestedHasMermaid")) }}
|
{{- $wantsMermaid := or (.Page.Store.Get "hasMermaid") (and (.Page.Store.Get (printf "%sIsNested" (partial "output-format.hugo" .Page))) (.Page.Store.Get "nestedHasMermaid")) }}
|
||||||
{{- if $wantsMermaid }}
|
{{- if $wantsMermaid }}
|
||||||
<script src="{{"js/jquery.svg.pan.zoom.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
<script src="{{"js/jquery.svg.pan.zoom.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||||
{{- if isset .Params "custommermaidurl" }}
|
{{- if isset .Params "custommermaidurl" }}
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
useMermaid( JSON.parse({{ $.Scratch.Get "mermaidInitialize" }}) );
|
useMermaid( JSON.parse({{ $.Scratch.Get "mermaidInitialize" }}) );
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $wantsSwagger := or (.Page.Store.Get "hasSwagger") (and (.Page.Store.Get (printf "%sIsNested" ((partial "output-format.html" .Page) | lower))) (.Page.Store.Get "nestedHasSwagger")) }}
|
{{- $wantsSwagger := or (.Page.Store.Get "hasSwagger") (and (.Page.Store.Get (printf "%sIsNested" (partial "output-format.hugo" .Page))) (.Page.Store.Get "nestedHasSwagger")) }}
|
||||||
{{- if $wantsSwagger }}
|
{{- if $wantsSwagger }}
|
||||||
{{- if isset .Params "customswaggerurl" }}
|
{{- if isset .Params "customswaggerurl" }}
|
||||||
<script src="{{ .Params.customSwaggerURL }}" defer></script>
|
<script src="{{ .Params.customSwaggerURL }}" defer></script>
|
||||||
|
|
|
@ -43,4 +43,4 @@ except the current one. */}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- return $current }}
|
{{- return .OutputFormats.Get $current }}
|
|
@ -25,7 +25,7 @@
|
||||||
{{- partial "stylesheet.html" . }}
|
{{- partial "stylesheet.html" . }}
|
||||||
{{- partial "custom-header.html" . }}
|
{{- partial "custom-header.html" . }}
|
||||||
</head>
|
</head>
|
||||||
<body class="mobile-support {{ ((partial "output-format.html" .) | lower) }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}" data-url="{{ .RelPermalink }}">
|
<body class="mobile-support {{ (partial "output-format.hugo" .) }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}" data-url="{{ .RelPermalink }}">
|
||||||
<div id="body" class="default-animation">
|
<div id="body" class="default-animation">
|
||||||
<div id="sidebar-overlay"></div>
|
<div id="sidebar-overlay"></div>
|
||||||
<div id="toc-overlay"></div>
|
<div id="toc-overlay"></div>
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<main id="body-inner" class="highlightable {{ partial "archetype.html" (dict "hook" "styleclass" "page" . "parameter" .) }}" tabindex="-1">
|
<main id="body-inner" class="highlightable {{ partial "archetype.hugo" (dict "hook" "styleclass" "page" . "parameter" .) }}" tabindex="-1">
|
||||||
<div class="flex-block-wrapper">
|
<div class="flex-block-wrapper">
|
||||||
<div id="head-tags">
|
<div id="head-tags">
|
||||||
{{- partial "tags.html" . }}
|
{{- partial "tags.html" . }}
|
||||||
|
|
|
@ -1,8 +1 @@
|
||||||
<h1>Create this Page</h1>
|
{{- partial "initial.md" . | markdownify }}
|
||||||
<p>
|
|
||||||
You need to create a file for this page. You can either
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>create an _index.md, index.md or otherly named markdown file (depending on Hugo's bundle type) in <b>content</b> folder and fill it with Markdown content</li>
|
|
||||||
<li>create an <b>index.html</b> file in the <b>static</b> folder and fill the file with HTML content</li>
|
|
||||||
</ul>
|
|
6
layouts/partials/initial.md
Normal file
6
layouts/partials/initial.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Create this Page
|
||||||
|
|
||||||
|
You need to create a file for this page. You can either
|
||||||
|
|
||||||
|
- 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 <b>static</b> folder and fill the file with HTML content
|
|
@ -5,8 +5,7 @@
|
||||||
{{- $gen := hugo.Generator }}
|
{{- $gen := hugo.Generator }}
|
||||||
{{- $gen = replaceRE "\\s*/>$" ">" $gen }}
|
{{- $gen = replaceRE "\\s*/>$" ">" $gen }}
|
||||||
{{ $gen | safeHTML }}
|
{{ $gen | safeHTML }}
|
||||||
{{- $ver := partial "version.html" }}
|
{{- $ver := partial "version.txt" }}
|
||||||
{{- $ver = replaceRE "\\s*(\\S*)" "${1}" $ver }}
|
|
||||||
{{- $ver := printf "<meta name=\"generator\" content=\"%s %s\">" "Relearn" $ver }}
|
{{- $ver := printf "<meta name=\"generator\" content=\"%s %s\">" "Relearn" $ver }}
|
||||||
{{ $ver | safeHTML }}
|
{{ $ver | safeHTML }}
|
||||||
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
|
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- $page.Page.Store.Set (printf "%sIsNested" ((partial "output-format.html" $page) | lower)) true }}
|
{{- $page.Page.Store.Set (printf "%sIsNested" (partial "output-format.hugo" $page)) true }}
|
||||||
{{- with $page }}
|
{{- with $page }}
|
||||||
{{- $currentNode := . }}
|
{{- $currentNode := . }}
|
||||||
{{- $isActive := .IsHome }}
|
{{- $isActive := .IsHome }}
|
||||||
|
@ -92,8 +92,8 @@
|
||||||
{{- $currentNode := .currentnode }}
|
{{- $currentNode := .currentnode }}
|
||||||
{{- with .sect }}
|
{{- with .sect }}
|
||||||
{{- $page := . }}
|
{{- $page := . }}
|
||||||
{{- $content := partial "output-partial.html" (dict "base" "content" "page" . "parameter" $page) }}
|
{{- $content := partial "output-partial.hugo" (dict "base" "content" "page" . "parameter" $page) }}
|
||||||
{{- partial "output-partial.html" (dict "base" "output-article" "page" $page "parameter" (dict "page" $page "content" $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 "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 "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")) }}
|
{{- $currentNode.Page.Store.Set "nestedHasSwagger" (or ($currentNode.Page.Store.Get "nestedHasSwagger") (.Page.Store.Get "hasSwagger")) }}
|
|
@ -1,12 +0,0 @@
|
||||||
{{- $page := .page }}
|
|
||||||
{{- $content := .content }}
|
|
||||||
{{- $r_url := $page.RelPermalink }}
|
|
||||||
{{- with $page.OutputFormats.Get (partial "output-format.html" $page) }}
|
|
||||||
{{- $s_url := .RelPermalink }}
|
|
||||||
{{- if not (eq $s_url $r_url) }}
|
|
||||||
{{/* if we have a relative link in output formats with a path setting, our URLs are one level to deep; so we are making them absolute to our page by prepending the page's permalink */}}
|
|
||||||
{{- $link_prefix := strings.TrimRight "/" $page.Page.RelPermalink }}
|
|
||||||
{{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- partial "output-partial.html" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }}
|
|
6
layouts/partials/output-format.hugo
Normal file
6
layouts/partials/output-format.hugo
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{{- $format := partial "get-format.hugo" . }}
|
||||||
|
{{- $ret := "default" }}
|
||||||
|
{{- if $format }}
|
||||||
|
{{ $ret = $format.Name | lower }}
|
||||||
|
{{- end }}
|
||||||
|
{{- return $ret }}
|
|
@ -1,10 +0,0 @@
|
||||||
{{- $base := .base }}
|
|
||||||
{{- $page := .page }}
|
|
||||||
{{- $parameter := .parameter }}
|
|
||||||
{{- if or (not (partial "output-format.html" $page)) (not (fileExists (printf "/layouts/partials/%s.%s.html" $base ((partial "output-format.html" $page) | lower)))) }}
|
|
||||||
{{- if (fileExists (printf "/layouts/partials/%s.html" $base)) }}
|
|
||||||
{{- partial (printf "%s.html" $base) $parameter }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else }}
|
|
||||||
{{- partial (printf "%s.%s.html" $base ((partial "output-format.html" $page) | lower)) $parameter }}
|
|
||||||
{{- end }}
|
|
12
layouts/partials/output-partial.hugo
Normal file
12
layouts/partials/output-partial.hugo
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{{- $base := .base }}
|
||||||
|
{{- $page := .page }}
|
||||||
|
{{- $parameter := .parameter }}
|
||||||
|
{{- $format := partial "output-format.hugo" $page }}
|
||||||
|
{{- $suffix := partial "output-suffix.hugo" $page }}
|
||||||
|
{{- if or (not $format) (not (fileExists (printf "/layouts/partials/%s.%s.%s" $base $format $suffix))) }}
|
||||||
|
{{- if (fileExists (printf "/layouts/partials/%s.%s" $base $suffix)) }}
|
||||||
|
{{- partial (printf "%s.%s" $base $suffix) $parameter }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- partial (printf "%s.%s.%s" $base $format $suffix) $parameter }}
|
||||||
|
{{- end }}
|
8
layouts/partials/output-suffix.hugo
Normal file
8
layouts/partials/output-suffix.hugo
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{{- $format := partial "get-format.hugo" . }}
|
||||||
|
{{- $ret := "html" }}
|
||||||
|
{{- if $format }}
|
||||||
|
{{- range first 1 $format.MediaType.Suffixes }}
|
||||||
|
{{- $ret = . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- return $ret }}
|
|
@ -5,7 +5,7 @@
|
||||||
{{- $currentNode.Scratch.Delete "relearnIsHiddenNode" }}{{/* the node itself is flagged as hidden */}}
|
{{- $currentNode.Scratch.Delete "relearnIsHiddenNode" }}{{/* the node itself is flagged as hidden */}}
|
||||||
{{- $currentNode.Scratch.Delete "relearnIsHiddenStem" }}{{/* the node or one of its parents is flagged as hidden */}}
|
{{- $currentNode.Scratch.Delete "relearnIsHiddenStem" }}{{/* the node or one of its parents is flagged as hidden */}}
|
||||||
{{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }}{{/* the node is hidden from the current page */}}
|
{{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }}{{/* the node is hidden from the current page */}}
|
||||||
{{- $currentNode.Scratch.Delete (printf "%sWantsMathJax" ((partial "output-format.html" $currentNode) | lower)) }}
|
{{- $currentNode.Scratch.Delete (printf "%sWantsMathJax" (partial "output-format.hugo" $currentNode)) }}
|
||||||
{{- $wantsMathjax := or (and (ne $currentNode.Params.disableMathjax nil) (not $currentNode.Params.disableMathjax)) (and (ne .Site.Params.disableMathjax nil) (not .Site.Params.disableMathjax)) }}
|
{{- $wantsMathjax := or (and (ne $currentNode.Params.disableMathjax nil) (not $currentNode.Params.disableMathjax)) (and (ne .Site.Params.disableMathjax nil) (not .Site.Params.disableMathjax)) }}
|
||||||
{{- if $wantsMathjax }}
|
{{- if $wantsMathjax }}
|
||||||
{{- $currentNode.Store.Set "hasMathJax" true }}
|
{{- $currentNode.Store.Set "hasMathJax" true }}
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{{- $page := .page }}
|
|
||||||
{{- $content := .content }}
|
|
||||||
{{- $page.Page.Store.Set (printf "%sIsNested" ((partial "output-format.html" $page) | lower)) false }}
|
|
||||||
{{- partial "output-partial.html" (dict "base" "output-article" "page" $page "parameter" (dict "page" $page "content" $content)) }}
|
|
4
layouts/partials/single-article.hugo
Normal file
4
layouts/partials/single-article.hugo
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{{- $page := .page }}
|
||||||
|
{{- $content := .content }}
|
||||||
|
{{- $page.Page.Store.Set (printf "%sIsNested" (partial "output-format.hugo" $page)) false }}
|
||||||
|
{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content)) }}
|
|
@ -1,5 +1,5 @@
|
||||||
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
|
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
|
||||||
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use -->
|
{{ "<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use -->" | safeHTML }}
|
||||||
<link href="{{"css/fontawesome-all.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;">
|
<link href="{{"css/fontawesome-all.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;">
|
||||||
<link href="{{"css/featherlight.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;">
|
<link href="{{"css/featherlight.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;">
|
||||||
<link href="{{"css/auto-complete.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;">
|
<link href="{{"css/auto-complete.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;">
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
<link href="{{"css/ie.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
<link href="{{"css/ie.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||||
<link href="{{"css/variant.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
<link href="{{"css/variant.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||||
<link href="{{"css/print.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print">
|
<link href="{{"css/print.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print">
|
||||||
{{- if (fileExists (printf "/static/css/format-%s.css" ((partial "output-format.html" .) | lower))) }}
|
{{- if (fileExists (printf "/static/css/format-%s.css" (partial "output-format.hugo" .))) }}
|
||||||
<link href="{{(printf "css/format-%s.css" ((partial "output-format.html" .) | lower)) | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
<link href="{{(printf "css/format-%s.css" (partial "output-format.hugo" .)) | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<script src="{{"js/variant.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
<script src="{{"js/variant.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
5.0.3+tip
|
|
1
layouts/partials/version.txt
Normal file
1
layouts/partials/version.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
5.0.3+tip
|
Loading…
Reference in a new issue