A simple way to write static blog sites using markdown, written in Golang.
This was done to reduce fatigue writing static sites using only JavaScript or TypeScript based frameworks.
Hugo exist to solve this problem, but I want to to do something from scratch to really understand how a simple static site generator can work.
For version 1, the aim would be to have the following:
- A single binary as a command line tool to parse markdown files and output html
- simple templated index page
- global injection for css / js
- css reset added
- fix image routing - pass a static image folder duing build phase
- landing page generation
- custom override for single page css
- templating fragments of headers / footers / navigation
- easy seo integration
- Dev server for listening / registering file changes from the MarkDown files
- two stage build, parse target dir to markdown
- serves via native go http package
- add local filewatcher for hot-reload
- unit & integration testing
- part 1 - file system + markdown parser
- buildServe freezes the last item in memory, shows the same page despite different routes (did not handle loop closure in range)
- fsnotify does not seem to restart webserver (windows file saved as write, macos shows rename / create so reload fails, linux untested)
- dev serve serves EVERYTHING in target path...
- fix recursion directory and file traversal
Enter frontend folder, with go version 1.22 minimally, and run go build, this should execute a frontend binary file.
- building:
./frontend -cmd=build -source=<target_markdown_folder> -target=<output_folder> - serving:
./frontend serve -target=<output_folder>(only serves html for now) - watch serve:
./frontend --cmd devStart --target ../website/blog - watch build:
./frontend --cmd devServe --target ../website/blog --assets ../website/blog/images
- public directory is always ignored in this repo