Opabinia is a simple markdown server and a compiler for static sites, written in Go. I created it as the engine for my personal website.
- A simple web server with the
Chi
router for serving static files and markdown pages. - Go Markdown parser for pages, enhanced with custom rendering extensions.
- Structured logging via slog.
- My custom implementation of an in-memory LFU cache for rendered pages.
- Configuration structure using
gopkg.in/yaml.v3
. - Code formatting with
gofumpt
, set as a git hook.
# Install the opabinia engine
go install github.com/dissipative/opabinia
# Create a directory for your markdown files and assets:
opabinia --init <project name>
# Start the engine with:
cd <project name>
opabinia --serve
# Compile a static website with:
opabinia --compile
Where to put your files:
- Put entry point
index.md
to project root directory. - Put other markdown files to
pages/
. - Put images and other assets to
assets/
.
Edit the template at templates/default.tmpl
. You can also create your own one and specify it in the configuration
file opabinia.yml
.
You can find an example of the project structure and settings in the layout
directory.
- Compiler: handle resources in HTML tags.
- Ensure link consistency for both the compiler and server.
- Migrate to Go 1.21.
- Increase test coverage.
- Implement cache TTL.
- Implement live reloading for the
--serve
mode.