From ad35c3ce48e1cac250f50e821190a2a60e74c659 Mon Sep 17 00:00:00 2001 From: David Pordomingo Date: Fri, 9 Nov 2018 15:20:54 +0100 Subject: [PATCH 1/2] Add .vscode file to .gitignore Signed-off-by: David Pordomingo --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2f027e1b..c7bff24c 100644 --- a/.gitignore +++ b/.gitignore @@ -27,8 +27,9 @@ package-lock.json .env.local .DS_Store -# intellij +# code editors .idea +.vscode # python - used to prepare the content sometimes **/.ipynb_checkpoints From 8699c9448be7b8fc3a63b92f1b77028fe81285fe Mon Sep 17 00:00:00 2001 From: David Pordomingo Date: Fri, 9 Nov 2018 15:23:07 +0100 Subject: [PATCH 2/2] Create a json/all endpoint Signed-off-by: David Pordomingo --- content/json/all.md | 3 +++ themes/hugo-steam-theme/layouts/json/single.html | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 content/json/all.md diff --git a/content/json/all.md b/content/json/all.md new file mode 100644 index 00000000..2d4d8cd8 --- /dev/null +++ b/content/json/all.md @@ -0,0 +1,3 @@ +--- +title: all +--- diff --git a/themes/hugo-steam-theme/layouts/json/single.html b/themes/hugo-steam-theme/layouts/json/single.html index 07803835..66df0ca6 100644 --- a/themes/hugo-steam-theme/layouts/json/single.html +++ b/themes/hugo-steam-theme/layouts/json/single.html @@ -1,8 +1,17 @@ -{{ $pages := index .Site.Taxonomies.categories .Title }} +{{ if eq .Title "all" }} + {{ $pages := dict "Pages" .Site.RegularPages }} + {{ $.Scratch.Set "pages" $pages }} +{{else}} + {{ $pages := index .Site.Taxonomies.categories .Title }} + {{ $.Scratch.Set "pages" $pages }} +{{end}} + +{{ $pages := $.Scratch.Get "pages" }} + {{ $.Scratch.Set "first" true }} {"Posts": [ {{ range $k, $post := sort $pages.Pages "Date" "desc" }} - {{if eq $post.Type "post"}} + {{if and (eq $post.Type "post") (ne .Params.author nil) }} {{if $.Scratch.Get "first"}} {{ $.Scratch.Set "first" false }} {{ else }}