Lichen
Lichen is the simplest possible CMS for the web that is friendly enough for non-technical users. Comprised of just a few Forth CGI scripts, it is extremely lightweight. This site is built in Lichen. It can also be used as a static site generator.

Rationale
When looking for a way for non-programmers to edit their website, many people reach for WordPress or something similar, which consumes many times more computing resources than the moon lander. Plugins, security updates, and a SQL database are a lot of overhead for sharing text and images online. On the other hand, writing HTML and CSS by hand is so complex these days that the layperson has no time or interest to learn to do it, not to mention understanding what a SSH key is and how to edit the site over SFTP. Installing dependencies, compiling a static site, and managing a Git repo involves similar complexity.
Lichen is designed to hit the sweet spot between WordPress and manually editing HTML. A technically-inclined person can easily set up many Lichen sites for friends with minimal effort without having to worry about the technical burden of maintaining a database-driven CMS.
Content is stored as Gemtext, the lightweight markup language of the Gemini protocol. Why Gemtext?
- It's easier to learn and more forgiving than Markdown.
- You don't need a heavy JavaScript-enabled rich-text WYSIWYG editor.
- It's simple to parse and render.
- Constraints breed creativity.
- Content authored in Gemtext is automatically Gemini-friendly; a correctly-configured server can serve both protocols from a single source of content.
The content is the most important part of a site. When your content is constrained to a single column of text with hand-edited links, it is more intimate and intentional. The writer is required to make the content good enough to be worth reading without relying on the crutch of complex layouts and fancy web widgets. The reader is no longer burdened with heavy web pages and distracting/buggy UI. All of this adds up to an extremely lightweight environment: low cost, low resources, low cognitive overhead, low environmental impact.
Usage

Navigate to "/cgi-bin/edit.cgi" to edit your homepage. Changes you make to the raw Gemtext on the left are reflected in the live preview on the right.
Links to files with a .gmi extension will automatically be translated to .html. Links to files with common image, audio, and video extensions are automatically rendered to their respective HTML elements.
Click the green "Save" button at the bottom to save your content and render a fresh HTML file.

The file manager allows you to create new pages and folders, and upload files like images and videos.
Click on a Gemtext file (.gmi) to edit it.
Hover a file and click the 🔗 button to return to the editor and insert a link to that file. It will be inserted at the current cursor position.
Utils
If you need to rebuild all pages of your site, run the "./build.sh" script in the root directory.
System Requirements
- A POSIX-compatible environment
- A CGI-capable web server
- Gforth v0.7.3+
NearlyFreeSpeech is an excellent, inexpensive web host that works well with Lichen.
Installation
- Download Lichen and extract the contents to your web server's public folder
- Password-protect the /cgi-bin directory (more below)
- Verify that all .cgi files in the cgi-bin folder have execute permissions enabled
- Ensure that the public files can be written and modified by your web server; this may require changing file or directory permissions:
For example, run the following command on NearlyFreeSpeech in the public directory:
$ chgrp -R web /home/public
If your Apache server is not already configured to run CGI scripts, add this configuration and adjust the paths as necessary:
ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/ <Directory "/var/www/html/cgi-bin"> </Directory>
⚠️ Important ⚠️
Create an htpasswd file and update the path in the cgi-bin/.htaccess file. This password-protects the interface to edit your site.
If you're not using Apache, follow your web server's instructions.
Customize
A complete page is comprised of Gemtext rendered to HTML and sandwiched between the contents of "template/_header.html" and "template/_footer.html". Edit these template files to customize the HTML that is common between all pages. Remember to rebuild all pages with the "./build.sh" script after editing any template files (HTML is only re-generated when the "Save" button is clicked from the web interface).
Local Development
Most CGI-compatible web servers should work. Busybox provides a lightweight one.
$ busybox httpd -p 8000 -f
The Forth code expects the current working directory to be it's own directory (cgi-bin), not the web root. Python's http.server does not work because it doesn't set the CWD to /cgi-bin when invoking a CGI script.
Changelog
2.0 (2022-12-22)
- Rewrote from scratch in Forth
- Requires Gforth v0.7.3+ (PHP no longer required)
- Requires server with CGI support for editor
- Simplified server requirements: htaccess rewrites no longer used
- Includes static site generation script (editor component not required)
- Improved efficiency: changes are rendered to static HTML when saved rather than when the page is accessed
- Added warning when navigating away from editor source
- JPEG and PNG images are optionally resized in the browser before upload (no server component required)