Poaster
A utility to create and upload quick markdown posts to static websites. Specify post structure in ./config/config.json
and a wizard will walk you through post creation, then run a build and upload process that you specify.
Caveats
Right now this script has no data validation or error handling, and it doesn't sanitize input. If you screw up something in your front matter and your site fails to build, it will fail silently.
Usage
Clone the repo, create ./config/config.json
per your requirements, cd into ./Poaster
and run ruby ./poaster
.
Config
The config object must contain the following keys:
buildCommand
- Specify your build command here.postTypes
- Should contain an array of post type objects.uploadCommand
- Contains your upload command.siteDirectory
- The root directory of your site; this is where all commands will be run from.
Post type objects should contain:
name
- The name of the post type.postUnitName
- This is the word that the script will use to refer to the individual post being created.frontMatter
- An array of objects, each containing aname: ""
key-value pair.postDirectory
- The directory where post files should be output.
Example:
{
"buildCommand": "npx @11ty/eleventy",
"postTypes": [
{
"name": "Now Burning",
"postUnitName": "incense",
"frontMatter": [
{
"name": "title"
},
{
"name": "manufacturer"
},
{
"name": "date"
},
{
"name": "time"
}
],
"postDirectory": "/home/me/my-website/now-burning/"
}
],
"uploadCommand": "rsync ...",
"siteDirectory": "/home/me/my-website/"
}
Languages
Ruby
100%