~groovestomp/static-gemini

A static site builder for Gemini
af5f7a94 — Aaron Oman 11 months ago
Reverse sort date
Some further tweaks after using it.
Allow location of config file to be specified and improve documentation

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~groovestomp/static-gemini
read/write
git@git.sr.ht:~groovestomp/static-gemini

You can also use your local clone with git send-email.

#static-gemini

This is a static site generator targeting Gemini. The expected directory layout for the site source files is like so:

.
├── cfg.toml
├── main.gmi
├── about.gmi
├── page.tpl
├── gemlog
│   ├── 2021-07-28-entry.gmi
│   ├── index.tpl
│   ├── page.tpl
│   └── atom.tpl
└── poetry
    ├── 2021-07-28-entry.gmi
    ├── index.tpl
    ├── page.tpl
    └── atom.tpl

Each directory containing gemtext (.gmi) is expected to have a page.tpl file which uses Go templating.

The result of rendering the above directory looks like:

output
├── about.gmi
├── main.gmi
├── gemlog
│   ├── 2021-07-28-entry.gmi
│   ├── index.gmi
│   └── atom.xml
└── poetry
    ├── 2021-07-28-entry.gmi
    ├── index.gmi
    └── atom.xml

Each page template has the following variables:

.Site
  .Title
  .Url
.Page
  .Title
  .Date
  .Path
  .Content

Each index or atom template has the following variables:

.Site
  .Title
  .Url
.Pages # Array
  .Page
    .Title
    .Date
    .Path
    .Content

#Configuration

Currently there are only two options to set:

  • title
  • url

Example:

# cfg.toml
title = "My Website"
url = "gemini.test.org"

When running the executable, you can specify where the configuration file is:

static-gemini -c /path/to/my-config.toml in out

If not specified, it is assumed to be named cfg.toml and reside at the root of in.

#Reference Docs

TODO

#Installation

  • Clone this repo.
  • go build.
  • Copy static-gemini wherever you like; presumably on your $PATH.