I no longer use or maintain this script as of several years now. I moved to Hugo to deal with static sites to have tagging abilities and other things.
Blogs and RSS feeds in less than 100 SLOC. lb
stands for whatever. Maybe "Luke's blog", maybe "lightweight blog", maybe "less bloat", doesn't matter that much.
I've also added sup
, which is even more minimal and focused on old-school static websites with no blog, but a need for a site updater! See it at the bottom of this README.
Both lb
and sup
are mutually compatible and you can use them both on the same site and even feed into the same RSS feed.
lb
makes new blog posts which go to make standalone pages, a rolling blog file and an RSS entry. sup
, on the other hand, is if you manually add a new page to your website and want to make people know about that change. It can be run multiple times on a page for each time it is updated.
lb
Featureslb
is an extremely small shell script that lets you write blog posts and will format them in all the ways you could ever want. Here's what it will produce:
blog/
directory, which you can allow to be browsed manually via your Apache web server as I have here.lb
commands are all one letter cause I'm lazy. They all stand for something though.
./lb n(ew) # Make a new blog post draft.
./lb e(dit) # Edit a draft of an entry.
./lb t(rash) # Delete a draft of an entry.
./lb p(ublish) # Finalize/publish a blog post draft.
./lb d(elete) # Delete a published blog post.
./lb r(evise) # Revise an already published entry (you can republish it with `lb p` when done)
lb
script and put it in your website's main directory. The expectation is that your rolling blog file and RSS feed will be there as well.For the system to work, add the following comment line to a (1) Rolling Blog File (as above), a (2) Blog List File and (3) RSS feed.
<!-- LB -->
You can format these files/pages how ever you want, just be sure to edit the lb
file and change the variables at the top to match the file names of those you chose.
When you finalize
a blog post, it will be added directly below that line in the proper format (either HTML or the proper RSS/XML format), give you the rolling blog and RSS feed for free.
blog/
in your websites root directory. Drafts are in blog/.drafts
.blog/.htaccess
acts as a "database" file. lb
stores filenames with their corresponding proper names and publishing dates there.lb
. Only the lb
script itself is necessary.$EDITOR
variable should be set to your preferred text editor, vim will be assumed if you don't have one set.sup
-- Site updater or "What's up?"If having a "blog" is too cringe for you and you just want an RSS feed where you can post updates about recently changed pages, use sup
.
Let's say you make a page called favorite-programs.html
.
Just run sup favorite-programs.html
and that new page's content will be added to the RSS feed.
Specifically, sup
will get only the <body>
tag, but also exclude the <nav>
and <footer>
tags. All the rest of the content will be directly viewable via RSS.
If you update that page in the future, run sup
on it again and it will prompt you for an update message
sup
Just add the
<!-- LB -->
line in your RSS feed like for lb
above and be sure to change the variables (rss file name and website) in the sup
script.
sup
and lb
are fully compatible and can be run on the same website for different purposes.