mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
print: DRY partials #230
This commit is contained in:
parent
e8226f4d0e
commit
31c9c77c5e
14 changed files with 69 additions and 98 deletions
|
@ -1,4 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_list.html" . }}
|
||||||
{{- partial "content-screen.html" . }}
|
|
||||||
{{- partial "footer.html" . }}
|
|
|
@ -1,4 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_list.html" . }}
|
||||||
{{- partial "content-print.html" . }}
|
|
||||||
{{- partial "footer.html" . }}
|
|
|
@ -1,4 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_single.html" . }}
|
||||||
{{- partial "content-screen.html" . }}
|
|
||||||
{{- partial "footer.html" . }}
|
|
|
@ -1,4 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_single.html" . }}
|
||||||
{{- partial "content-print.html" . }}
|
|
||||||
{{- partial "footer.html" . }}
|
|
|
@ -1,23 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_taxonomy.html" . }}
|
||||||
<article>
|
|
||||||
|
|
||||||
<h1>{{ if eq .Kind "term" }}{{ .Data.Singular | humanize }} {{ default "::" .Site.Params.titleSeparator }} {{ end }}{{ .Title }}</h1>
|
|
||||||
<ul>
|
|
||||||
{{- range .Data.Terms.Alphabetical }}
|
|
||||||
{{- if and .Page.Title (or (ne (.Page.Scratch.Get "relearnIsHiddenStem") true) (ne .Page.Site.Params.disableTagHiddenPages true) ) }}
|
|
||||||
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> ({{ len .Pages }})</li>
|
|
||||||
{{- end }}
|
|
||||||
{{- else }}
|
|
||||||
{{- range sort .Pages "Title" }}
|
|
||||||
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
|
||||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<footer class="footline">
|
|
||||||
</footer>
|
|
||||||
</article>
|
|
||||||
{{- partial "footer.html" . }}
|
|
|
@ -1,23 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_taxonomy.html" . }}
|
||||||
<article>
|
|
||||||
|
|
||||||
<h1>{{ if eq .Kind "term" }}{{ .Data.Singular | humanize }} {{ default "::" .Site.Params.titleSeparator }} {{ end }}{{ .Title }}</h1>
|
|
||||||
<ul>
|
|
||||||
{{- range .Data.Terms.Alphabetical }}
|
|
||||||
{{- if and .Page.Title (or (ne (.Page.Scratch.Get "relearnIsHiddenStem") true) (ne .Page.Site.Params.disableTagHiddenPages true) ) }}
|
|
||||||
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> ({{ len .Pages }})</li>
|
|
||||||
{{- end }}
|
|
||||||
{{- else }}
|
|
||||||
{{- range sort .Pages "Title" }}
|
|
||||||
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
|
||||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<footer class="footline">
|
|
||||||
</footer>
|
|
||||||
</article>
|
|
||||||
{{- partial "footer.html" . }}
|
|
|
@ -1,22 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
{{- .Scratch.Set "relearnOutputFormat" "HTML" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_index.html" . }}
|
||||||
{{- if .Site.Home.Content }}
|
|
||||||
{{- partial "content-screen.html" .Site.Home }}
|
|
||||||
{{- else }}
|
|
||||||
<article>
|
|
||||||
|
|
||||||
<h1>Customize your own home page</h1>
|
|
||||||
<p>
|
|
||||||
The site is working. Don't forget to customize this page with your own. You typically have 3 choices :
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li><b>1.</b> Create an _index.md document in <b>content</b> folder and fill it with Markdown content</li>
|
|
||||||
<li><b>2.</b> Create an <b>index.html</b> file in the <b>static</b> folder and fill the file with HTML content</li>
|
|
||||||
<li><b>3.</b> Configure your server to automatically redirect home page to one your documentation page</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<footer class="footline">
|
|
||||||
</footer>
|
|
||||||
</article>
|
|
||||||
{{- end }}
|
|
||||||
{{- partial "footer.html" . }}
|
|
|
@ -1,22 +1,2 @@
|
||||||
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
{{- .Scratch.Set "relearnOutputFormat" "PRINT" }}
|
||||||
{{- partial "header.html" . }}
|
{{- partial "_index.html" . }}
|
||||||
{{- if .Site.Home.Content }}
|
|
||||||
{{- partial "content-print.html" .Site.Home }}
|
|
||||||
{{- else }}
|
|
||||||
<article>
|
|
||||||
|
|
||||||
<h1>Customize your own home page</h1>
|
|
||||||
<p>
|
|
||||||
The site is working. Don't forget to customize this page with your own. You typically have 3 choices :
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li><b>1.</b> Create an _index.md document in <b>content</b> folder and fill it with Markdown content</li>
|
|
||||||
<li><b>2.</b> Create an <b>index.html</b> file in the <b>static</b> folder and fill the file with HTML content</li>
|
|
||||||
<li><b>3.</b> Configure your server to automatically redirect home page to one your documentation page</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<footer class="footline">
|
|
||||||
</footer>
|
|
||||||
</article>
|
|
||||||
{{- end }}
|
|
||||||
{{- partial "footer.html" . }}
|
|
25
layouts/partials/_index.html
Normal file
25
layouts/partials/_index.html
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{{- partial "header.html" . }}
|
||||||
|
{{- if .Site.Home.Content }}
|
||||||
|
{{- if eq (.Scratch.Get "relearnOutputFormat") "PRINT" }}
|
||||||
|
{{- partial "body.print.html" .Site.Home }}
|
||||||
|
{{- else }}
|
||||||
|
{{- partial "body.html" .Site.Home }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
<article>
|
||||||
|
|
||||||
|
<h1>Customize your own home page</h1>
|
||||||
|
<p>
|
||||||
|
The site is working. Don't forget to customize this page with your own. You typically have 3 choices :
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li><b>1.</b> Create an _index.md document in <b>content</b> folder and fill it with Markdown content</li>
|
||||||
|
<li><b>2.</b> Create an <b>index.html</b> file in the <b>static</b> folder and fill the file with HTML content</li>
|
||||||
|
<li><b>3.</b> Configure your server to automatically redirect home page to one your documentation page</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<footer class="footline">
|
||||||
|
</footer>
|
||||||
|
</article>
|
||||||
|
{{- end }}
|
||||||
|
{{- partial "footer.html" . }}
|
7
layouts/partials/_list.html
Normal file
7
layouts/partials/_list.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{{- partial "header.html" . }}
|
||||||
|
{{- if eq (.Scratch.Get "relearnOutputFormat") "PRINT" }}
|
||||||
|
{{- partial "body.print.html" . }}
|
||||||
|
{{- else }}
|
||||||
|
{{- partial "body.html" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- partial "footer.html" . }}
|
7
layouts/partials/_single.html
Normal file
7
layouts/partials/_single.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{{- partial "header.html" . }}
|
||||||
|
{{- if eq (.Scratch.Get "relearnOutputFormat") "PRINT" }}
|
||||||
|
{{- partial "body.print.html" . }}
|
||||||
|
{{- else }}
|
||||||
|
{{- partial "body.html" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- partial "footer.html" . }}
|
22
layouts/partials/_taxonomy.html
Normal file
22
layouts/partials/_taxonomy.html
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{{- partial "header.html" . }}
|
||||||
|
<article>
|
||||||
|
|
||||||
|
<h1>{{ if eq .Kind "term" }}{{ .Data.Singular | humanize }} {{ default "::" .Site.Params.titleSeparator }} {{ end }}{{ .Title }}</h1>
|
||||||
|
<ul>
|
||||||
|
{{- range .Data.Terms.Alphabetical }}
|
||||||
|
{{- if and .Page.Title (or (ne (.Page.Scratch.Get "relearnIsHiddenStem") true) (ne .Page.Site.Params.disableTagHiddenPages true) ) }}
|
||||||
|
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> ({{ len .Pages }})</li>
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- range sort .Pages "Title" }}
|
||||||
|
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<footer class="footline">
|
||||||
|
</footer>
|
||||||
|
</article>
|
||||||
|
{{- partial "footer.html" . }}
|
Loading…
Reference in a new issue