forked from gitea/blog
jolheiser
9978b12eac
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 <dev.lh@web.de> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: jolheiser <john.olheiser@gmail.com> Co-committed-by: jolheiser <john.olheiser@gmail.com>
6 lines
234 B
JSON
6 lines
234 B
JSON
{{- $.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 -}}
|