Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/marcomilon/gstatic
- Owner: marcomilon
- License: mit
- Created: 2020-04-18T17:49:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-21T18:39:09.000Z (about 1 year ago)
- Last Synced: 2024-06-21T04:59:49.735Z (7 months ago)
- Topics: golang, static-site, static-site-generator, static-website
- Language: Go
- Homepage:
- Size: 277 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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