Static site generator using Go templates.
- Go 100%
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| License.txt | ||
| main.go | ||
| Readme.md | ||
| root.go | ||
sitegen
Static site generator using Go templates.
Installation
go install codeberg.org/nimbletools/sitegen
Usage
Make a layout.html and a pages folder. In your layout, use {{ yield . }}
somewhere. This is where the page contents will go. Routes are automatically
computed from the files and folders in pages. You can use the static folder
for any static files.
To start a development server in the current directory:
sitegen watch
When the development server is running, the browser will automatically refresh the page when a file is updated on disk.
Building
To build the static site to the build folder in the current directory:
sitegen build
Example structure
* `layout.html`
* `pages/index.html` -> `/`
* `pages/about.html` -> `/about`
* `pages/projects/index.html` -> `/projects`
* `pages/projects/sitegen.html` -> `/projects/sitegen`