Skip to content

Phillip-England/flint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flint

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/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:

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

Then, with go 1.23.3 or later:

go 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:

{
    "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.

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.

About

Language-Agnostic Static Sites

Resources

License

Stars

Watchers

Forks

Packages

No packages published