~axcelott/chop

Very minimal SSG generator based on Liquid-based templates. Written in ~200 lines of spaghetti JavaScript, utilizing the new Bun runtime.

Chop

Very minimal SSG generator based on Liquid-based templates. Written in ~300 lines of spaghetti JavaScript, utilizing the new Bun runtime.

Content

Content is written in CommonMark Markdown. Chop also supports Front Matter, to define variables that can later be used in your post, or in your templates.

Templates

Templates are placed in the templates directory. The templates directory should contain subdirectories for each desired output (in my example I have web, rss, gemini).

The following two files from the subdirectory will be used:

After building, the assembled files will be put in a dist directory. It also contains a subdirectory for every output.

Global variables

Global variables can be defined in the optional config.yaml file. Variables defined here are available in templates.

I'm working on the ability to use variables in content.

Special variables

These variables have special behavior, if specified:

Builtin variables

The following variables are exposed by default:

In the case of an index, there is one more variable:

Static files

Chop supports two types of static files:

Images will be scaled down to a maximum resolution and then compressed. CSS and JavaScript are minified.

Renderers

Depending on the extension of the template, your content will be translated either to HTML (.html or .xml), gemtext (.gmi) or kept as-is (everything else).

Example configuration

Here's the folder structure for a simple blog:

~/blog
|- static
   |- images
      |- example.jpg
      |- avatar.png
|- templates
   |- web
      |- static
         |- main.css
      |- index.html
      |- default.html
   |- rss
      |- index.xml
|- config.yaml
|- hello-world.txt
|- index.txt