Static Site generator for buildings blogs written in Chicken Scheme.
For an example blog made with wing check out mine.
I've written a few blog posts about wing if you want some more context:
Ensure you have necessary native dependencies:
On Alpine Linux:
doas apk add chicken cmark-dev util-linux-dev
wing uses the cmark native C library as part of its markdown rendering process. Make sure that is installed before installing the egg.
It also uses the native C uuid library.
The easiest way to get started is to simply run:
This will use the egg file to download dependencies, compile the code, and install it.
chicken-install cmark sxml-transforms uuid simple-md5 srfi-19 srfi-13 srfi-1 atom
Use the chicken compiler to create the static wing binary.
To initialize a project make a new directory. Inside the empty directory run
init - Prompt to fill in config file fields.
new - Prompt to fill in post fields.
publish - List unpublished posts and prompt the user to select one to publish. Publishing means the meta information is stored in the posts database.
revert - Remove the head (most recent) of the published posts list in posts.scm.
build - Read posts.scm and/or
layouts.scm file generate static assets.
help - List commands with descriptions.
Use a file server to preview the built content in the static directory.
Typically one serves files with nginx, apache, or caddy. However, for local purposes you don't need all that.
Here are a couple of simple file servers that I like.
serve - Actually simple cli file server in Golang. No external dependencies.
serve -dir static
sfz - Easy to use, but not as simple as advertized.
Which will prompt you for the title, description, and tags. Dates are handled for you.
This will generate a markdown file in the posts directory.
Your post will look something like this:
title: hello world
summary: Saying hello to the world
tags: hello world blogging
The filename will be: hello-world.md
To have multiline code blocks make sure to use 4 spaces on each line of code. Or else lowdown will put all lines of code on one line...
The date format used throughout wing is the RFC3339. The chicken scheme template string looks like this:
wing uses a function called current-rfc3339-date to generate a string looking like this:
wing uses a simple but powerful way to track updates of posts. The center piece of this design is the posts.scm file.
The most important thing to know about this file is don't touch this file!!!
This file looks like this:
(tags ("foo" "bar"))
(published "") ;; RFC3339 date
(updated ""))) ;; RFC3339 date
When build is run after any updates wing will adjust the updated date field and provide the new md5 hash field. This means there is no manual date effort on the author's part.
The config.scm file is generated by using the values provided in the initial prompt.
The most important thing to know about this file is don't touch this file!
For the most part I consider wing to be feature complete, but I am open to bug fixes and quality of life improvements.
Before sending patches make sure your changes pass the integration test:
Once you are confident in your changes you can send patches to:
In the case you are new to email based git workflows please refer to this tutorial.
wing: Simple Static Site generator for Chicken Scheme Copyright (C) 2020 email@example.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.