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
- Host: GitHub
- URL: https://github.com/holedaemon/static
- Owner: holedaemon
- License: mit
- Created: 2025-01-10T22:02:08.000Z (over 1 year ago)
- Default Branch: trunk
- Last Pushed: 2025-02-12T15:47:04.000Z (over 1 year ago)
- Last Synced: 2025-02-12T16:28:22.374Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 487 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)