Flint

Phillip England_

Flint

Language-Agnostic Static Sites

 1  ##########  ##   ##    ###      ##  ########
 2  ##          ##         ####     ##     ##
 3  #######     ##   ##    ## ##    ##     ##
 4  ##          ##   ##    ##  ##   ##     ##
 5  ##          ##   ##    ##   ##  ##     ##
 6  ##          ##         ##    ## ##     ##
 7  ##          #########  ##     ####     ##
 8-------------------------------------------------
 9Language-Agnostic Static Sites
10-------------------------------------------------
11🔥 sparking flint
12🗃️ searching for flint.json
13🔎 parsing routes from flint.json
14🏹 making an http request to each route
15🔨 generating static html assests
16🗑️ removing ./out
17✍️ writing minified, static html to ./out
18🖌️ copying over minified, static assests from ./static
19✏️ copying over the favicon from ./favicon.ico to ./out
20⚠️ Favicon does not exist at: ./favicon.ico
21📚 your assets have been bundled at ./out
22🙏 thank you for using flint
23⭐ dont forget to give me star at: https://github.com/phillip-england/flint

What is Flint?

flint is a static site generator that works regardless of the way you build your application. Run you app on localhost, setup your flint.json and run flint spark to generate your static assets.

Installation

To install, clone the repo:

1git clone https://github.com/phillip-england/flint

Then, with go 1.23.3 or later:

1go build -o flint main.go

Then, you can move flint somewhere on your PATH to use on your system.

Config

flint requires a flint.json to gain a bit of context on how to build your assets.

Here is an example flint.json:

 1{
 2    "host": "http://localhost:8080",
 3    "static": "./static",
 4    "favicon": "./favicon.ico",
 5    "out": "./out",
 6    "target": "https://phillip-england.github.io/www.stacijs.com",
 7    "routes": [
 8        "/",
 9        "/docs/signals",
10        "/docs/events",
11        "/docs/observers",
12        "/docs/installation"
13    ]
14}

Let's break down each item.

Host

The host is simply where your application is running. Right now, flint focuses on building local applications, but it could be extended to generate static sites from MPA running on the web.

Static

static tells flint where to find static assets associated with the running application. These assets will be bundled and minified during the generation process.

Favicon

favicon tells flint where to find the favicon.ico for the application.

Out

out lets flint know where to place the static assets after generation.

Target

target tells flint where the application will be deployed. This enables flint to crawl all of the relative link= and src= attributes on elements and change them from relative paths to absolute paths. This ensures all links are properly transformed and work as expected in the target environment.

Routes

routes tells flint which endpoints to hit during static site generation.

Running

To generate static assets, run flint spark. From there, you can take the out directory and plop it wherever you deploy your static sites. Enjoy.