I have created a public domain/0BSD-licensed static website generator similar to werc, written in under 350 lines of Nim. It generates the websites by converting markdown documents into html pages that have links to other pages arranged in a nested list mirroring the directory structure of the site, title, subtitle, and footer. To generate your own site, just navigate to the root directory you want to become your website and run nerc. It will recurse through all the subdirectories finding markdown files and generating corresponding web pages.
Some things to note:
- Markdown documents named readme.md`(case insensitive) get turned into `index.htm files -- this is so you can use github to host your website, and get an equivalent experience browsing the repo.
- files and directories starting with a . will be ignored.
- Directories without a readme.md in them will not be hyperlinked in the sidebar, but their contents will still be linked.
- This generates files ending in .htm. Any pages you create manually ending in .htm will be ignored. If they end in .html, however, it will get linked.
- You can define your own page template, named template.htm and place it in a directory. All pages in that directory and its subdirectories will inherit that page template.
- These are valid template tags: <!--page title-->, <!--styles-->, <!--links-->, <!--site title-->, <!--subtitle-->, <!--sidebar-->, <!--content-->, <!--footer left-->, <!--footer right-->
- You can define your own config.json file that can override the default settings.
- valid config.json key/value pairs are: "page title": "<string>", "links": [ {"label": "<string>", "link": "<string>"}, ... ], "site title": "<string>", "subtitle": "<string>", "footer left": "<string>", "footer right": "<string>".
- Like page templates, you can have multiple config.json files, and they will be inherited by all other pages in the directory and its subdirectories.
- You can also override the default styles.css and it will be applied to all pages in its directory and subdirectories, though I'd recommend modifying the one that gets placed in the root directory for now.
Here's the link: https://github.com/8bitprodigy/nerc