I know a couple of you guys out there use my blog script, lb, for your personal blogs. Advertised as a "Blog & RSS system in less than 100 lines of shell script". It's minimal, easy to customize and I've been using it for months now. If you didn't see the original video, there's the link.
The script allows you to write blog posts that are then automatically syndicated in several locations of your choosing:
- A rolling blog page: lukesmith.xyz/blog.html
- A blog index page (can be placed in your index if desired): lukesmith.xyz/blogindex.html
- All posts appear in the blog/ directory, which can be accessible via Apache settings.
- RSS entries, containing the full blog post are added to your RSS feed of choice (e.g. lukesmith.xyz/rss.xml)
But yesterday I rewrote the script, actually making it shorter while adding some nice features.
- The ability to revise already published articles
- Smarter URL creation. The old script made somewhat dumb urls.
- Use of the
.htaccessfile as a database to store filename-title correspondences and now publishing dates
- In the editing mode, only the text content, not the header or footer will appear in your editor. This is a side-effect of the fact above, since before, I had used the magic of script-kiddery to read from the buffer on publishing to determine the post's title. Now it's stored in
.htaccessso that's not necessary.
The script is backwards compatible with the old script, although the commands have slightly changed (just run the command and it will tell you how) and if you've been working on unpublished drafts in lb 1.0, you must still publish them with lb 1.0. This backwards compatibility means that you can also revise old published blog entries without much of a problem. The only hiccup is the fact that if you revise a blog entry published with lb 1.0, when republished it will appear only with the new date. This should not be true of articles published by this lb 2.0.
To "install" the blog script, simply download it to the wanted blog directory and change the variables in it to seek the correct files (the RSS feed, blog file, blog index). You must add a comment line that looks exactly like this:
<!-- LB -->
to each file. That line is the point in the document after which new articles/RSS entries/list entries will be added. See the source files of my above linked pages for examples!