K-Sato1995 / go-simple-ssg

Minimalistic SSG(Static Site Generator) in Go

Home Page:https://go-simple-ssg.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What this is

Yet another SSG in Go. It's not intended to replace any existing SSGs. I created it as a learning exercise and really enjoyed the process.πŸ€—

Heavily inspired by this blog post(Writing a Static Blog Generator in Go) by @zupzup.

In case you are wondering how to use this, check out the Initialization process below.

Initialization

Install the cli.

go install github.com/K-Sato1995/go-simple-ssg/simple-ssg-cli@latest

run

simple-ssg-cli init

would create a new project that looks somethi ng like this.

./
β”œβ”€β”€ contents/ (Stores markdown files)
β”œβ”€β”€ templates/ (Stores template html files and style files)
β”œβ”€β”€ generated/ (Stores generated files)
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
└── main.go

cd your project and just run

go run main.go

You should be able to see the site running on http://localhost:3001

Todo

  • CLI To run generating static contents based on the config file
    • put all the code in one func
    • create cmd to copy the template
  • write tests
  • Custom Error pages(404)
  • HMR
  • SEO stuffda

About

Minimalistic SSG(Static Site Generator) in Go

https://go-simple-ssg.vercel.app


Languages

Language:HTML 58.2%Language:Go 27.2%Language:CSS 14.6%