From 8df90589bf62d633eb1f0c1e6d4fc50445628923 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 23 Aug 2021 19:32:05 +0200 Subject: Make hugo generate a json index of the website --- config.toml | 3 +++ layouts/index.json | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 layouts/index.json diff --git a/config.toml b/config.toml index 7294f53..cc41e95 100644 --- a/config.toml +++ b/config.toml @@ -29,6 +29,9 @@ resampleFilter = "CatmullRom" quality = 75 anchor = "smart" +[outputs] +home = ["HTML", "RSS", "JSON"] + [params] copyright = "Julien (Adyxax) Dessaux" github_repo = "https://git.adyxax.org/adyxax/www" diff --git a/layouts/index.json b/layouts/index.json new file mode 100644 index 0000000..a526e68 --- /dev/null +++ b/layouts/index.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- $.Scratch.Add "index" (dict "title" .Title "subtitle" .Params.subtitle "description" .Params.description "tags" .Params.tags "content" .Plain "permalink" .Permalink) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} -- cgit v1.2.3