A simple static site generator that uses pandoc for most of the work, written in bash, forked from https://gitlab.com/uoou/blop
Go to file
Drew 692a1c1dcc archive 2019-09-30 14:24:25 +01:00
LICENSE blop 2019-09-26 06:26:09 +01:00
README.md archive 2019-09-30 14:24:25 +01:00
blop blop 2019-09-30 10:50:29 +01:00
blop_logo.png archive 2019-09-30 14:24:25 +01:00

README.md

blop

Very simple bash based static site generator with absolutely no features at all. Only real dependency is pandoc.

Example blog and repo for that blog so you can see what's what.

Installation

Clone the repo and copy the script wherever you like it, curl it, copy and paste. Whatever you fancy, it's a bash script.

Usage

Run it in the directory where you want your blog to live then upload/push the resulting html to wherever you like.

It expects the following things:

markdown/

A directory called markdown which contains the markdown files that will be turned into html blog posts.

index_template.html

This is the file the blog's index.html will be built from. Put whatever html you like in here. The post listing will replace the <!--post-list--> html comment in this file. You can rejig what gets listed in an option near the top of the blop script itself.

post_template.html

Similar to the index template, this is the basis for individual blog posts. The following html comments will be replaced with what you'd expect: <!--title-->, <!--author-->, <!--date--> and <!--post-->.

archive_template.html

This is the basis of archive.html which is where posts beyond the $max_posts variable in the script will be put. $max_posts can be set to "unlimited". The archive list will replace the <!--archive list--> comment in this file.

The rest you can do with as you wish - write as much or as little html as you like, CSS it up, include javascript and images and videos and whatnots.

rss_template.xml

This is the template for the RSS feed. What a surprise. Fiddle as you like. <!--url--> will be replaced by the site's base url (taken from url.txt) and <!--rss---> will be replaced with the rss items (i.e. your blog post contents).

url.txt

This file should contain the url of your blog's root, without a trailing slash. This is used to provide the absolute links in the RSS feed.

There are a few variables you can set at the top of the script, they should be self-explanatory (and are commented).

There are examples for all of these files over at the example blog.

The blog's title (which is derrived from the filename of the markdown) and author (which defaults to the value at the top of the blop script) can, either or both, be overridden on a per-post basis by putting information at the top of the markdown file in the following form (including dashes):

---
author: Someone
title: Some Title
---

The rest you can do with as you like. Put whatever static html you want in the root and link to it from other pages, add an images folder, lots of CSS, videos, under-construction animated gifs...

Each time blop is run it will delete all the html files in the posts directory (so don't put any other static content in there, make a separate directory or put it in the root), the index.html file and rss.xml. It won't touch anything else.