Add a root API with all pages
Useful for some helper scripts
This commit is contained in:
parent
5a80b161cf
commit
cabc93dd5d
3 changed files with 10 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Homepage
|
title: Homepage
|
||||||
|
outputs: [html, rss, json]
|
||||||
---
|
---
|
||||||
Part Developer, Part SysAdmin, Part InfoSec, All Nerd!
|
Part Developer, Part SysAdmin, Part InfoSec, All Nerd!
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{- $result := slice -}}
|
{{- $result := slice -}}
|
||||||
|
|
||||||
{{- range (where .Site.RegularPages "Section" "!=" "") -}}
|
{{- range (where .Site.RegularPages "Section" "!=" "") -}}
|
||||||
{{- $data := dict "title" .Title "content" .Plain "id" (.File.UniqueID) -}}
|
{{- $data := dict "title" .Title "content" .Plain "id" .File.UniqueID -}}
|
||||||
{{- $result = $result | append $data -}}
|
{{- $result = $result | append $data -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
8
layouts/index.json
Normal file
8
layouts/index.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{{- $result := slice -}}
|
||||||
|
|
||||||
|
{{- range .Site.RegularPages -}}
|
||||||
|
{{- $data := dict "title" .Title "id" .File.UniqueID "url" .Permalink "path" .RelPermalink "section" .Section -}}
|
||||||
|
{{- $result = $result | append $data -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ jsonify $result }}
|
Loading…
Reference in a new issue