blowfish/layouts/partials/series.html

28 lines
1.4 KiB
HTML
Raw Normal View History

2022-10-17 13:43:29 -05:00
{{ 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" {{
if .Params.seriesOpened | default (.Site.Params.article.seriesOpened | default false) }} open {{ end }}>
2022-10-17 16:28:39 -05:00
<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 }} - {{ i18n "article.part_of_series" }}
2022-10-17 16:28:39 -05:00
</summary>
2022-12-31 11:22:23 -06:00
{{ $seriesName := strings.ToLower (index .Params.series 0) }}
{{ $seriesNameURL := strings.Replace $seriesName " " "-" }}
{{ range $post := sort (index .Site.Taxonomies.series $seriesNameURL) "Params.series_order" }}
2022-10-17 16:28:39 -05:00
{{ 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">
{{ i18n "article.part" }} {{ $post.Params.series_order }}: {{ i18n "article.this_article" }}
2022-10-17 16:28:39 -05:00
</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}}">
{{ i18n "article.part" }} {{ $post.Params.series_order }}: {{ $post.Params.title}}
2022-10-17 16:28:39 -05:00
</a>
</div>
{{end}}
{{end}}
</details>
2022-12-31 11:22:23 -06:00
{{end}}