Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chasefleming/elem-ssg
Go Static Site Generator Template
https://github.com/chasefleming/elem-ssg
go golang ssg static-site-generator
Last synced: about 1 month ago
JSON representation
Go Static Site Generator Template
- Host: GitHub
- URL: https://github.com/chasefleming/elem-ssg
- Owner: chasefleming
- Created: 2023-12-07T21:25:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-03T14:49:29.000Z (11 months ago)
- Last Synced: 2024-10-14T09:56:07.224Z (3 months ago)
- Topics: go, golang, ssg, static-site-generator
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `elem-ssg` Template
This template is designed for building a static site generator using Go, featuring `elem-go` for HTML templating and `goldmark` for Markdown processing.
To learn more about these two libraries, check out the following links:
- [elem-go](https://github.com/chasefleming/elem-go)
- [goldmark](https://github.com/yuin/goldmark)For a deeper walkthrough of how to use this template, check out the [elem-ssg tutorial](https://dev.to/chasefleming/building-a-go-static-site-generator-using-elem-go-3fhh).
## Usage
To use this template, click the green "Use this template" button at the top of the page. This will create a new repository in your account with the contents of this template.
### Prerequisites
To use this template, you will need to have Go installed on your machine. You can download Go from the [official Go website](https://golang.org/dl/).
### Project Structure
```
your-project/
│
├── main.go # Main Go file for the generator
├── posts/ # Directory for your Markdown posts
├── public/ # Directory for generated HTML files
└── go.mod # Go module file
```## Adding Content
To add content to your site, simply add Markdown files to the `posts/` directory. The generator will automatically convert these Markdown files to HTML files and place them in the `public/` directory.
To run the generator, use the following command:
```bash
go run main.go
```## Viewing Your Site
To view your site, open the `public/index.html` file in your browser.
### Mac/Linux
```bash
open public/index.html
```### Windows
```bash
start public/index.html
```