Simple JSON to Gopher script in node.js that allows a hugo json file to be server over a simple implementation of the Gopher protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Martijn de Boer 409eda21de NL 12 months ago
.gitignore add ignores 12 months ago Configuration message 12 months ago
app.js NL 12 months ago
configuration.example Include configuration.example 12 months ago

Reads a flat JSON file and makes it publishable as a gophermenu. The configuration options speak for themselves. Copy configuration.example to configuration.json.

Just a quick script. It should be better at some point.


  • add directories
  • add sorting

If you use Hugo as my intended purpose for this script, add JSON to your TOML configuration.

	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 -}}

The json format should be like this:

		"body": "Textual contents of item 1",
		"title": "Item 1",
		"uri": "/items/1"
		"body": "Textual contents of item 2",
		"title": "Item 2",
		"uri": "/items/2"

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 if you want me to check it out.