An open API service indexing awesome lists of open source software.

https://github.com/holedaemon/static

A simple tool for scaffolding static sites
https://github.com/holedaemon/static

Last synced: 6 months ago
JSON representation

A simple tool for scaffolding static sites

Awesome Lists containing this project

README

          

# static

A simple CLI tool used to quickly scaffold static sites.

# Installation

> [!WARNING]
> `static` has only been used and tested on Linux

With the Go toolchain:

```sh
$ go install github.com/holedaemon/static
```

# Usage

Assuming `static` is in your `$PATH`, run it once to generate a `static.json` file, which looks like:

```json
{
"directory": ".",
"title": "",
"description": "",
"author": "",
"address": "",
"use_sass": true,
"use_dprint": true,
"use_task": true
}
```

Edit to your liking and run `static` again to scaffold a project based on the given settings.

One can also configure `static` with environment variables by passing the `-e` flag. Loading variables from an adjacent file `.env` is also supported using the `-f` flag. Passing `-f` implicitly enables `-e`.

```env
STATIC_DIRECTORY=.
STATIC_TITLE=
STATIC_DESCRIPTION=
STATIC_AUTHOR=
STATIC_ADDRESS=
STATIC_USE_SASS=true
STATIC_USE_DPRINT=true
STATIC_USE_TASK=true
```

# Structure

Sites generated with `static` are tailored specifically to how *I* write them, which is with [templated HTML](https://caddyserver.com/docs/caddyfile/directives/templates) and [Sass](https://sass-lang.com).

```sh
example.com/
├── Caddyfile
├── dprint.json
├── .gitignore
├── include
│   ├── head.html
│   └── page.html
├── index.html
├── static
│   └── font
│   ├── ROBOTO_MONO.ttf
│   └── ROBOTO.ttf
├── style
│   ├── abstract
│   │   ├── _derived-variables.scss
│   │   ├── _functions.scss
│   │   ├── _initial-variables.scss
│   │   ├── _mixins.scss
│   │   └── _variables.scss
│   ├── base
│   │   ├── _base.scss
│   │   ├── _fonts.scss
│   │   └── _reset.scss
│   └── main.scss
└── Taskfile.yml
```

# License

[LICENSE](LICENSE)