summaryrefslogtreecommitdiffstats
path: root/layouts/index.json
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/index.json')
-rw-r--r--layouts/index.json13
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/index.json b/layouts/index.json
new file mode 100644
index 0000000..e17e31e
--- /dev/null
+++ b/layouts/index.json
@@ -0,0 +1,13 @@
+{{- $articles := where .Site.RegularPages "Section" "articles" -}}
+{{- $articles = $articles.ByDate.Reverse -}}
+[
+ {{- range $index, $article := $articles -}}
+ {
+ "title": {{ $article.Title | jsonify }},
+ "url": {{ $article.Permalink | jsonify }},
+ "date": {{ $article.Date.Format "Jan 02, 2006" | jsonify }},
+ "summary": {{ substr ($article.Summary | plainify) 0 160 | jsonify }}
+ }
+ {{- if ne (add $index 1) (len $articles) }},{{ end }}
+ {{- end }}
+]