my site generator
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Nico 6ff72101e7 changes and fixes 6 months ago
example add example site 11 months ago
.gitignore update gitignore 11 months ago
LICENCE initial shared version 11 months ago
README.md update readme 11 months ago
linluwi.fnl changes and fixes 6 months ago

README.md

linluwi

linluwi (noun)
network, Internet (toki pona)

linluwi is a static website and gemini capsule generator, originally written for my own personal use. It handles static pages and content and maintaining a log with RSS and ass feeds. It's intended to be small and easy to hack on, and to maintain parity between the web and gemini versions of a site.

Installation

linluwi is written in the fennel programming language, so you will need to download and set up a fennel environment, following the instructions from the fennel website. I would recommend running fennel in a lua environment rather than using the executable, as you will also need the luafilesystem library, which is easiest downloaded using luarocks:

luarocks install luafilesystem

with both of these installed, put the linluwi.fnl file from this repository in a new directory. You can now run linluwi using fennel linluwi.fnl.

Usage

To configure linluwi, you will need to modify the configuration variables at the top of linluwi.fnl. These are commented as to what they do, and should be changed to whatever is appropriate to your site. Once you have configured linluwi, you can start using it!

Your input content needs to go in a content directory, by default called "content" in the same directory as linlui.fnl (changable with the configuration variables). Input pages are in the gemtext format and have the extension .gmi. These files will be converted to HTML for the web output and formatted properly for a gemini capsule for the gemini output. .gmi files in a subdirectory called log will also be processed as log posts (see below). All other files (images, stylesheets, .html files in the input, etc) are copied into the output unchanged. All files (including pages and log posts) keep their position in the input directory structure.

linluwi has no theme system and makes no attempt to manage stylesheets. This is left to the user (for example, by putting a .css file in the input directory and adding a stylesheet link to it in your HTML header).

To generate your site, run fennel linlui.fnl in the directory where you have the script saved. This should create the public_html and public_gemini directories, which you can then upload to your hosts.

log posts

Log posts (.gmi files in a log subdirectory of the content directory) are handled slightly differently than other input files. In addition to being converted and copied to the output like pages, they have some specific metadata (required in the post file) that is used to generate basic blog and gemlog index pages (see https://itwont.work/log for an example).

Log posts may have any filename, but I recommend making filenames descriptive of the content, as they are also used as the URL slugs for posts. The first two lines of a log post must be in the format:

# title
YYYY-MM-DD

where YYYY-MM-DD is the date of posting. For example:

# Look at this Awesome Thing!
2022-01-05

The rest of the content of a post is processed exactly like any other page.

See the example site in example/ to see this structure.

Support

if you use this tool and find any issues, you can contact me via mastodon at @nihilazo@tiny.tilde.website or via email on nico@itwont.work (where I will also accept patches).