jolheiser 9978b12eac Index JSON (#249)
This will expose a JSON endpoint with all the pages and some meta.

It would allow us to, for example, filter posts by `tag` and maybe link to them from our main docs.

e.g. a follow-up PR to tag any "feature preview"-style posts and then link to them from our docs.

Reviewed-on: gitea/blog#249
Reviewed-by: delvh <>
Reviewed-by: Lunny Xiao <>
Co-authored-by: jolheiser <>
Co-committed-by: jolheiser <>
2023-04-11 22:30:13 +08:00

6 lines
234 B

{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "contents" .Plain "permalink" .Permalink) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}