diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 41 |
1 files changed, 40 insertions, 1 deletions
@@ -1,3 +1,42 @@ # ssg-blog -A minor modification to the 'ssg' bash script to generate a simple blog
\ No newline at end of file +This is a modification to the simple static site generator '[ssg](https://romanzolotarev.com/bin/ssg)' by Roman Zolotarev. This generates a minimal blog index page with category headings. + +# Install / Usage + +See [https://romansolotarev.com/ssg.html](https://romanzolotarev.com/ssg.html) for documentation on ssg + +In short: +1. Install [lowdown](https://kristaps.bsd.lv/lowdown/) +2. Copy the `ssg` script somewhere in your path, e.g. `/usr/bin/` +3. `chmod +x /usr/bin/ssg` +4. `ssg src dst 'my-website-name' 'https://my-website.net'` + +ssg-blog checks for subdirectories in the src directory, each of which becomes a category heading (non-recursively). It will generate a sorted list of links to any .md file in those directory (including nested directories). Each .md file needs frontmatter including the title and a YYYY-MM-DD date like this to be included in the index page: + +```markdown +--- +title: My Blog Post +date: 2024-10-09 +--- +``` + +## Example + +There is an example directory in this repo to show you how to set up the files (src) and what the output looks like (dst). Note how articles can be nested in subdirectories or not and that the articles titled index.md get links created without .html appended. This was the command used to generate the example output: + +``` +./ssg-blog example/src example/dst 'example-site-name' 'https://example.org' +``` + +## Change how categories are sorted + +The category headings are sorted alphabetically. If you want to change this, you have to edit the `sort` on this line: + +``` +find "$src" -mindepth 1 -maxdepth 1 -type d ! -path "*/.*" | sort | +``` + +# Alternatives + +You might also be interested in the similar fork [fmash16/ssg5](https://github.com/fmash16/ssg5) which generates a more traditional blog with pagination, keywords, and post previews. |
