Add topic tags, fix series

This commit is contained in:
JP Hastings-Spital 2024-05-17 14:24:56 +01:00
parent ee20985898
commit 1b1953edd6
4 changed files with 16 additions and 1 deletions

View file

@ -124,6 +124,7 @@
From <a href="/tags/from-goodreads/#">goodreads archive</a>
</p>
{{ end }}
{{ partial "topic-tags.html" . }}
{{ partial "tags.html" .Params.tags }}
{{ partial "series-tags.html" . }}
<p>

View file

@ -4,7 +4,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pen-tool meta-icon"><path d="M12 19l7-7 3 3-7 7-3-3z"></path><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path><path d="M2 2l7.586 7.586"></path><circle cx="11" cy="11" r="2"></circle></svg>
{{ range . -}}
{{ $series := (index site.Taxonomies.series (. | urlize)).Pages.ByDate }}
{{ $series := (index site.Taxonomies.series (. | lower)).Pages.ByDate }}
{{ $seriesCount := len $series }}
{{ $numInSeries := 0 }}

View file

@ -186,6 +186,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M15.387 17.944l-2.089-4.116h-3.065L15.387 24l5.15-10.172h-3.066m-7.008-5.599l2.836 5.598h4.172L10.463 0l-7 13.828h4.169"/></svg>
{{- else if (eq .name "telegram") -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
{{- else if (eq .name "topic") -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>
{{- else if (eq .name "trakt") -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 32 32" fill="currentColor" ><path d="M16 32c-8.817 0-16-7.183-16-16s7.183-16 16-16c8.817 0 16 7.183 16 16s-7.183 16-16 16zM16 1.615c-7.932 0-14.385 6.453-14.385 14.385s6.453 14.385 14.385 14.385c7.932 0 14.385-6.453 14.385-14.385s-6.453-14.385-14.385-14.385zM6.521 24.708c2.339 2.557 5.724 4.152 9.479 4.152 1.917 0 3.735-0.417 5.369-1.167l-8.932-8.907zM25.573 24.62c2.052-2.281 3.307-5.323 3.307-8.625 0-5.177-3.047-9.62-7.421-11.677l-8.12 8.099 12.219 12.204zM12.401 13.38l-6.765 6.74-0.907-0.907 15.421-15.416c-1.301-0.437-2.692-0.677-4.151-0.677-7.115-0.005-12.885 5.765-12.885 12.88 0 2.896 0.953 5.573 2.588 7.735l6.74-6.74 0.479 0.437 9.663 9.661c0.197-0.109 0.38-0.219 0.556-0.353l-10.703-10.672-6.468 6.473-0.907-0.905 7.38-7.381 0.479 0.443 11.281 11.251c0.177-0.136 0.339-0.292 0.5-0.421l-12.181-12.157-0.109 0.021zM16.464 14.749l-0.901-0.9 6.38-6.385 0.907 0.916-6.385 6.38zM22.521 5.979l-7.36 7.36-0.907-0.907 7.36-7.359 0.907 0.911z"/></svg>
{{- else if (eq .name "threema") -}}

View file

@ -0,0 +1,12 @@
{{ $topics := .Params.topics }}
{{ if gt (len $topics) 0 }}{{ with $topics }}
<p>
{{ partial "svg.html" (dict "name" "topic") }}
<span class="topics">
{{ range $i, $topic := . }}
<a href="/topics/{{ $topic | urlize }}/">{{$topic}}</a>{{ if lt $i (sub (len $topics) 1) }}, {{ end }}
{{ end }}
</span>
</p>
{{ end }}{{ end }}