series improvements

This commit is contained in:
Nuno Coração 2022-10-29 17:02:14 +01:00
parent 6f1ab5638a
commit ecbab2a7a6
3 changed files with 27 additions and 3 deletions

View file

@ -77,5 +77,3 @@ The new image resizing features also provide full control over `alt` and `title`
## A whole lot more
There's countless other features to explore. From being able to display taxonomies on articles and list pages, to using the new `headline` author parameter to customise your homepage. There's also improved JSON-LD strucured data which further optimises SEO performance.
---

View file

@ -31,6 +31,8 @@
<div class="min-w-0 min-h-0 max-w-prose">
{{ partial "series.html" . }}
{{ .Content | emojify }}
</br></br></br>
{{ partial "series-closed.html" . }}
</div>
<script>

View file

@ -0,0 +1,24 @@
{{ if .Params.series }}
<details style="margin-left:0px" class="mt-2 mb-5 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5">
<summary
class="py-1 text-lg font-semibold cursor-pointer bg-primary-200 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-primary-800 dark:text-neutral-100">
{{ index .Params.series 0 }} - This article is part of a series.
</summary>
{{ range $post := sort (index .Site.Taxonomies.series (index .Params.series 0 | urlize)) "Params.series_order" }}
{{ if eq $post.Permalink $.Page.Permalink }}
<div
class="py-1 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
Part {{ $post.Params.series_order }}: This Article
</div>
{{ else }}
<div
class="py-1 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
<a href="{{$post.Permalink}}">
Part {{ $post.Params.series_order }}: {{ $post.Params.title}}
</a>
</div>
{{end}}
{{end}}
</details>
{{end}}