mirror of https://gitea.com/gitea/blog.git
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: https://gitea.com/gitea/blog/pulls/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>
This commit is contained in:
parent
223db5bdac
commit
9978b12eac
|
@ -19,6 +19,12 @@ params:
|
|||
author: Gitea
|
||||
website: https://blog.gitea.io
|
||||
|
||||
outputs:
|
||||
home:
|
||||
- HTML
|
||||
- RSS
|
||||
- JSON
|
||||
|
||||
menu:
|
||||
page:
|
||||
- name: Website
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{{- $.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 -}}
|
Loading…
Reference in New Issue