Static site builder optimized for single-page stacked posts.
Go to file
Zane Schaffer 66ecf73651 Merge branch 'dev-server-testing' 2022-08-27 20:58:03 -07:00
.github/workflows feat: add github workflow 2022-08-03 16:51:29 -07:00
.vscode tests: add more cli tests 2022-08-19 14:53:09 -07:00
testdata fix: update docs and change template name 2022-08-24 13:52:50 -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 fix: update docs and change template name 2022-08-24 13:52:50 -07:00
builder.go refactor: seperate input data processing into own functino 2022-08-09 14:42:12 -07:00
cli.go fix: update docs and change template name 2022-08-24 13:52:50 -07:00
cli_test.go fix: update docs and change template name 2022-08-24 13:52:50 -07:00
go.mod tests: add more cli tests 2022-08-19 14:53:09 -07:00
go.sum tests: add more cli tests 2022-08-19 14:53:09 -07:00
jenga.png docs: add logo 2022-08-03 18:32:01 -07:00
jenga.tmpl fix: update docs and change template name 2022-08-24 13:52:50 -07:00
jenga.toml fix: update docs and change template name 2022-08-24 13:52:50 -07:00
main.go chore: remove unneeded Println's 2022-08-10 09:44:18 -07:00

README.md

Jenga

Go Reference build Go Report Card

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 jenga.tmpl 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 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>

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.

Credits

Jenga Logo by Xinrui Chen

Original Go gopher eyes were. designed by Renee French