Posix Shell Script Blog Generator Sharing


View the script

sb.sh

Directory structure

├── assets
│   └── main.css
├── content
│   ├── index.html
│   └── blogs
│       ├── post1.html
│       ├── post2.html
│       └── ...
├── layouts
│   ├── root.html
│   ├── head.html
│   ├── header.html
│   └── footer.html
├── public
│   ├── index.html
│   ├── index.xml
│   └── blogs
│       ├── index.html
│       ├── post1
│       │   └── index.html
│       ├── post2
│       │   └── index.html
│       └── ...
└── static

Short Description

assets is for putting things that will not be put in public directory. The reason I put main.css there is because css are compiled directly in html using the script. content directory is for putting html files, these html files contains toml like header, followed by things that is supposed to be put in main tag.

+++ 
title="Page title"
date=yyyy-mm-dd
description="Page description"
keywords="keywords, separated, by, commas"
css="./assets/main.css"
+++ 

In layout directory, there are the template html that you can customise. These can be created by ./sb.sh -i. The script will also create RSS feed for sub-pages automatically. Lastly, everything in static directory will be copied to public directory.