Compare commits

...

3 Commits

Author SHA1 Message Date
f677a3731c Add a series nav shortcode to display navigation early
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-19 22:03:33 -07:00
a8549922c3 Trim more whitespace from template
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-19 21:57:25 -07:00
db9433bda1 Extract series navigation into a partial
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-06-19 21:56:00 -07:00
4 changed files with 34 additions and 26 deletions

View File

@ -424,3 +424,7 @@ blockquote {
margin-left: 0;
padding-left: 1rem;
}
.early-navigation-wrapper {
margin-bottom: 3rem;
}

View File

@ -2,44 +2,32 @@
<h2>{{ .Title }}</h2>
<div class="post-subscript">
<p>
{{ range .Params.tags }}
{{- range .Params.tags -}}
<a class="button" href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{- end -}}
</p>
<p>{{ i18n "postedOn" (.Date.Format "January 2, 2006") }}.</p>
</div>
<div class="post-content">
{{ if not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>") }}
{{- if not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>") -}}
<div class="table-of-contents">
<div class="wrapper">
<em>{{ i18n "tableOfContents" }}</em>
{{ .TableOfContents }}
<em>{{- i18n "tableOfContents" -}}</em>
{{- .TableOfContents -}}
</div>
</div>
{{ end }}
{{- end -}}
{{ if .Draft }}
{{ partial "warning.html" (i18n "postDraft") }}
{{ end }}
{{- if .Draft -}}
{{- partial "warning.html" (i18n "postDraft") -}}
{{- end -}}
{{ .Content }}
{{- .Content -}}
</div>
{{ end }}
{{ define "after" }}
{{ $term := index (.GetTerms "series") 0 }}
{{ with $term }}
{{- /* No idea why the 'Reverse' is needed? */ -}}
{{ $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse }}
<nav id="SeriesNavigation" class="container">
{{ with $pages.Prev page }}
{{ partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "page" .) }}
{{ end }}
{{ with $pages.Next page }}
{{ partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "page" .) }}
{{ end }}
</nav>
{{ end }}
{{- end -}}
{{- define "after" -}}
{{- partial "seriesnav.html" . -}}
<hr class="container footer-divider">
<footer class="container">
<p>{{ i18n "contactFooter" | safeHTML }}</p>
@ -51,4 +39,4 @@
to learn more about me!</p>
-->
</footer>
{{ end }}
{{- end -}}

View File

@ -0,0 +1,13 @@
{{ $term := index (.GetTerms "series") 0 }}
{{ with $term }}
{{- /* No idea why the 'Reverse' is needed? */ -}}
{{ $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse }}
<nav id="SeriesNavigation" class="container">
{{ with $pages.Prev page }}
{{ partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "page" .) }}
{{ end }}
{{ with $pages.Next page }}
{{ partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "page" .) }}
{{ end }}
</nav>
{{ end }}

View File

@ -0,0 +1,3 @@
<div class="early-navigation-wrapper">
{{ partial "seriesnav.html" .Page }}
</div>