opabinia

command module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

README

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.

What's Inside

  • 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.

Working with Opabinia

# 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.

To Do

  • 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.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL