From 4862963d1de215566cb8f9f17adff2fa3217a720 Mon Sep 17 00:00:00 2001 From: Martijn de Boer Date: Mon, 7 Jan 2019 21:34:04 +0100 Subject: [PATCH] quick writeup --- README | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..ee16e01 --- /dev/null +++ b/README @@ -0,0 +1,32 @@ +Reads a flat JSON file and makes it publishable as a gophermenu. +The configuration options speak for themselves. + +Just a quick script. It should be better at some point. + +TODO +- add directories +- add sorting + +If you use [Hugo](https://gohugo.io) as my intended purpose for this script, +add JSON to your TOML configuration. + +``` +[outputs] + home = ["HTML","RSS","JSON"] +``` + +And create a JSON output in your theme folder called index.json: +``` +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- $.Scratch.Add "index" (dict "title" .Title "body" .Plain "id" .Permalink) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} +``` + +This removes a bit of formatting too agressively but alas. + +LICENSE; +Just give some attribution and do what you want with this. + +Also let me know @sexybiggetje@mastodon.social if you want me to check it out. \ No newline at end of file