Language-Agnostic Static Sites
########## ## ## ### ## ########
## ## #### ## ##
####### ## ## ## ## ## ##
## ## ## ## ## ## ##
## ## ## ## ## ## ##
## ## ## ## ## ##
## ######### ## #### ##
-------------------------------------------------
Language-Agnostic Static Sites
-------------------------------------------------
π₯ sparking flint
ποΈ searching for flint.json
π parsing routes from flint.json
πΉ making an http request to each route
π¨ generating static html assests
ποΈ removing ./out
βοΈ writing minified, static html to ./out
ποΈ copying over minified, static assests from ./static
βοΈ copying over the favicon from ./favicon.ico to ./out
β οΈ Favicon does not exist at: ./favicon.ico
π your assets have been bundled at ./out
π thank you for using flint
β dont forget to give me star at: https://github.com/phillip-england/flintflint 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.
To install, clone the repo:
git clone https://github.com/phillip-england/flintThen, with go 1.23.3 or later:
go build -o flint main.goThen, you can move flint somewhere on your PATH to use on your system.
flint requires a flint.json to gain a bit of context on how to build your assets.
Here is an example flint.json:
{
"host": "http://localhost:8080",
"static": "./static",
"favicon": "./favicon.ico",
"out": "./out",
"target": "https://phillip-england.github.io/www.stacijs.com",
"routes": [
"/",
"/docs/signals",
"/docs/events",
"/docs/observers",
"/docs/installation"
]
}Let's break down each item.
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 tells flint where to find static assets associated with the running application. These assets will be bundled and minified during the generation process.
favicon tells flint where to find the favicon.ico for the application.
out lets flint know where to place the static assets after generation.
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 tells flint which endpoints to hit during static site generation.
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.