A tool for building static single page blogs in Go.
Jenga is a no frills, fast-enough static site builder written in Go. It is optimized for single-page infinite scrolling blogs. Jenga takes a source directory of markdown files and an HTML template and spits outs a full HTML blog.
In the releases tab you will find pre-built binaries for Linux, Windows and macOS (Intel and Apple Silicon). Otherwise, Jenga can compile and run anywhere Go can!
Clone the source from GitHub and install:
git clone https://github.com/zschaffer/jenga.git
cd jenga
go install
Jenga has some basic setting up in order to get going; sort of like the real game!
Jenga uses Go's html/template
library for template construction. Read their doc's for more information on how to manipulate your data. The basic thing required in your jenga.tmpl
is a {{.}}
block to render the data converted from your .md
files.
The included jenga.tmpl
file looks something like this:
<body>
<!-- Wrap everything in a div -->
<div>
<!-- Map over all your input .md files -->
{{range .}}
<!-- Wrap each input file in a div tag -->
<div>{{.}}</div>
<!-- End the map -->
{{end}}
</div>
</body>
Jenga uses TOML as a configuration language (for now). TOML is structured with keys
and values
like mykey = myvalue
.
Jenga has three keys it looks for in order to run:
InputFileDir = "/path/to/your/markdown/files"
OutputDir = "/path/to/your/output/folder"
TemplatePath = "/path/to/your/template.html"
Note: TOML is case-sensitive so make sure you get those keys right!
Jenga only takes one flag, -config
, that indicates to Jenga where your jenga.toml
file is.
jenga #If you don't pass any flags - default is "./jenga.toml"
# OR
jenga -config="$HOME/.config/jenga.toml"
Running Jenga will read through your source files, convert them to markdown, punch them into your template, and output them your your output directory - once you see the build is finished!
you're good to go!
From here you can use Cloudflare Page's or GitHub Pages to host your new site. Just point them at your new build folder and bam!
Jenga takes advantage of Go's super handy standard library for most things.
Other than that, Jenga currently relies on:
Shoutout to them because otherwise this would've been a lot trickier.
Jenga Logo by Xinrui Chen
Original Go gopher eyes were. designed by Renee French