Building a Site for My Fiction with ‘pblog’

thinking out loud, building in public

Tue, 26 Jul 2022

I’ve run into a few snags while building a new version of using pblog. If anybody is curious, I’ve got a git repo on Sourcehut.

  1. The main pblog script expects all pages to be in /pages, and doesn’t copy subdirectories under /pages to _output.
  2. pandoc doesn’t seem to support Fountain, a Markdown-style markup language for screenplays.
  3. I want to have both a blog and multiple serials, each with their own RSS feeds.

Calling rsync with the right switches will probably solve the first issue. I just need to RTFM and tinker a bit to figure out what they are.

While pandoc doesn’t have native support for Fountain, it can be extended using Lua scripts. The Github project for pandoc includes a repository for a Lua-based extension called pandoc-fountain, so I need not write my own extension.

The third problem is the complicated one. If all I wanted was a blog with all of its pages in the site’s root, pblog would do the job admirably. It’s got just about everything you need in one script, with a makefile playing a supporting role. However, Bradley Taunt didn’t have my use case in mind when he wrote pblog, and that is perfectly fine. Really, it is. Just as literature ain’t Burger King, neither is FOSS.

I should be able to use the script as the basis for my own scripts. For example, I can modify it so that it reads variables from a separate file, thus making it configurable and capable of generating multiple RSS feeds from different sources. This would allow me to have a blog with a separate feed from the serial I’ve started writing.

Before I get started, though, I should ask Bradley why builds posts twice, creating HTML files in a rss/ directory while also creating HTML files in /posts. If I could upload the same HTML that gets used to make the RSS feed, I could refactor more functionality out of and put it into the makefile.

Also, it might be worthwhile to get rid of the _output directory. python -m http.server can also serve the directory in which the makefile lives as http://localhost:8000, and if I don’t want to upload my source files I can create an exclusion file and pass that to rsync.