diff options
| author | historia <historiavg@proton.me> | 2026-09-08 17:31:49 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-08 17:31:49 -0400 |
| commit | c63794d3da3c599cf08854d30c0cf6f2b4ed1986 (patch) | |
| tree | 8cb2780b75ec4880646eab07563b1ca0831254ea /README.md | |
| parent | 317033703195fb1c5695e36e5899fe0080fc441e (diff) | |
| download | ssg-blog-c63794d3da3c599cf08854d30c0cf6f2b4ed1986.tar.gz | |
feat: explicitly listed and orderable categories
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -17,7 +17,7 @@ chmod +x /usr/bin/ssg-blog ssg-blog src dst '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). +Blog categories are hard-coded in the `CATEGORIES` variable at the top of the script. Each one becomes a category heading in the order listed. Blog posts should be in a directory with the same name. ``` ssg-blog/ @@ -60,14 +60,6 @@ Note a few things about the output: 2. Files named index.md will get have a link generated without <filename>.html at the end. 3. Files outside subdirectories (e.g. about.md) will be rendered but won't show up on the index. -## 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 | -``` - # Differences from ssg The title argument from ssg is unnecessary so I've removed it. `render_html_file` used it to modify the first `<h1>` tag and auto-populate the `<title>` if none is specified, which is functionality I've never needed. Instead I check the frontmatter of each blog post and update the `<title>` tag with the `title:` field. |
