From cf653e54ba77148a23d890fb2c9b592a1ec4c946 Mon Sep 17 00:00:00 2001 From: chris062689 Date: Mon, 5 Jun 2017 08:18:02 -0400 Subject: [PATCH] Added JSON file for games listings. --- site/config.toml | 3 +++ site/themes/citra-bs-theme/layouts/game/list.json | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 site/themes/citra-bs-theme/layouts/game/list.json diff --git a/site/config.toml b/site/config.toml index da21f0c..1136a23 100644 --- a/site/config.toml +++ b/site/config.toml @@ -10,3 +10,6 @@ paginate = 10 title = "Citra" description = "Citra is an open-source emulator for the Nintendo 3DS capable of playing many of your favorite 3DS games." weight = 1 + +[outputs] +section = [ "HTML", "JSON" ] diff --git a/site/themes/citra-bs-theme/layouts/game/list.json b/site/themes/citra-bs-theme/layouts/game/list.json new file mode 100644 index 0000000..fc95370 --- /dev/null +++ b/site/themes/citra-bs-theme/layouts/game/list.json @@ -0,0 +1,11 @@ +{ + {{- $lenGames := sub (len .Data.Pages) 1 }} + {{- range $index, $element := .Data.Pages }} + {{- $game := . }} + {{- $gameIndex := $index }} + {{- $lenRegions := sub (len .Params.releases) 1 }} + {{- range $regionIndex, $element := .Params.releases }} + "{{ $element.title }}": { "region": "{{ .region }}", "gameID": "{{ $game.File.BaseFileName }}", "gameName": "{{ $game.Title | plainify }}" }{{- if and (eq $gameIndex $lenGames) (eq $regionIndex $lenRegions) }}{{ else }},{{ end }} + {{- end }} + {{- end }} +}