Add tags JSON

This commit is contained in:
JP Hastings-Spital 2024-05-15 08:02:34 +01:00
parent 2e2f0b0f64
commit f60d372d5a
3 changed files with 13 additions and 1 deletions

7
content/tags/_index.md Normal file
View file

@ -0,0 +1,7 @@
---
outputs:
- html
- json
- gemini
- rss
---

View file

@ -23,7 +23,7 @@
<ul class="posts-list">
{{ range .Pages }}
<li class="post-item">
<a href="{{.RelPermalink}}">
<a href="{{.RelPermalink}}{{ if hasPrefix .RelPermalink "/tags/" }}#{{ end }}">
{{ if .Params.emoji }}<span class="post-emoji">{{ .Params.emoji }}</span>{{ end }}
<span class="post-title">{{ partial "page-title.txt" . }}</span>
<span class="post-day">

View file

@ -0,0 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
{{- range $index, $element := .Data.Pages.ByTitle -}}
{{- $.Scratch.Add "index" $element.Name -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}