Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/marcomilon/gstatic

A simple static website generator.
https://github.com/marcomilon/gstatic

golang static-site static-site-generator static-website

Last synced: 3 days ago
JSON representation

A simple static website generator.

Awesome Lists containing this project

README

        

# gStatic

A simple static website generator. The goal of the project is to create simple website generator.
gStatic is powered by Go’s html/template.

## Todo

- [x] Read all file on the template folder
- [x] Parse a yaml files and replace variables on the template
- [x] Write result to a public folder
- [x] Add support for layouts
- [x] Improve error handling
- [x] Add configuration
- [x] Add documentation on how to do templates

## Common language

* sourceFolder is the folder that has all the html files.
* targetFolder is the folder where the website will be written.
* Template is an Html file.
* Data-source is a file that variables to be use inside the html files.

## How gStatic finds the data-source for an Html file

gStatic use one convention.

> The name of the data-source must match the name of the html file.

Yaml files is the only data-source supported.

Example

| Template | Data-source | Result |
| ------------- |-------------|-----|
| index.html | index.yaml | index.html will be rendered using variables on index.yaml |
| aboutus.html | aboutus.yaml | aboutus.html will be rendered using variables on aboutus.yaml |
| contactus.html | if no yaml file for contactus | contactus.html will be copied to Target as it is |

## How it works?

See: https://blog.gopheracademy.com/advent-2017/using-go-templates/
and `website_example`.

## Usage

> gstatic <sourceFolder> <targetFolder>

Use -h for help

> gstatic -h