Static site builder optimized for single-page stacked posts.
Go to file
Zane Schaffer a8cbfd372c
docs: add logo
2022-08-03 18:32:01 -07:00
.github/workflows feat: add github workflow 2022-08-03 16:51:29 -07:00
testdata feat: refactor to builder 2022-08-03 15:17:58 -07:00
.gitignore fix: update .gitignore 2022-08-03 16:06:25 -07:00
LICENSE docs: add LICENSE 2022-08-03 16:57:00 -07:00
README.md Update README.md 2022-08-03 16:54:22 -07:00
builder.go feat: refactor to builder 2022-08-03 15:17:58 -07:00
cli.go feat: refactor to builder 2022-08-03 15:17:58 -07:00
cli_test.go feat: refactor to builder 2022-08-03 15:17:58 -07:00
go.mod feat: first mvp 2022-08-02 18:16:08 -07:00
go.sum feat: first mvp 2022-08-02 18:16:08 -07:00
jenga.png docs: add logo 2022-08-03 18:32:01 -07:00
jenga.toml feat: refactor to builder 2022-08-03 15:17:58 -07:00
main.go docs: add package comment 2022-08-03 17:24:52 -07:00
template.html fix: refactor down to two files 2022-08-03 12:03:26 -07:00

README.md

Jenga

build

A tool for building static single page blogs in Go.

Details

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.

Supported Platforms

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!

Build and Install from Source

Prerequisities

Clone the source from GitHub and install:

git clone https://github.com/zschaffer/jenga.git
cd jenga
go install

Usage

Jenga has some basic setting up in order to get going; sort of like the real game!

Set up your own template.html or copy it from the releases tab

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 template.html is a {{.}} block to render the data converted from your .md files.

The included template.html 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>

Set up your config jenga.toml file or copy it from the releases tab

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!

Run Jenga

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!

Dependencies

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.