gmb is a set of shell scripts used to generate and maintain a static microblog (in particular, this one). It supports RSS. Inspired by SoC (as seen here), but I wanted to write my own code, simply to learn how to do this.
Unless you want to publish only plain text but also want to insert hyperlinks, you still need to know basic HTML, but gmb will save you the hassle of editing your blog, writing the referrable timestamp/id and updating your RSS feed by hand.
Find and fork the code on GitHub. The code is licensed under the Apache License 2.0.
gmb depends on coreutils, grep, mktemp and sed, also you'll need a text editor of your choice. Note that, due to different behaviour of sed on macOS, gmb will only run on GNU operating systems.
~/.config/gmb/gmbrc
and edit it to set appropriate values.~/bin
and make them executable. If necessary, add ~/bin
to your $PATH.gmb is now ready for use.
Either launch gmb in interactive mode by simple invoking the script, then type your entry or prepare a textfile anywhere in your ~ and hand the absolute path to gmb as an argument.
Note that, as of now, gmb will only read one single line. Line breaks may be forced by either using the br tag or by closing the automatically added p tag and opening a new one.
gpe.sh (gmb post editor) helps to update the individual files that store the content of each blog post.
The string behind the second to last forward slash in an entries permanent path is handed to gpe.sh as an argument. The script will then read the necessary line, open the editor you set in gmbrc and allow for changes to be made. Saving and closing the editor will then have gpe.sh update the affected files.
As an example, suppose an entry was written on 2018-01-02 at 22:42:11 UTC. gpe.sh would be launched like so:
$ gpe.sh 201801/02224211.html
Download here.
Download here.
$tempfile
after each run, sinc /tmp is only cleared out on server reboot.gpe.sh
now uses mktemp instead of a hardcoded temporary file.Download here.
read
gmb now uses your editor of choice (defined in gmbrc) to let you write new blog entries.~/.config/gmb/
is called gmbrc again. One day I'll make up my mind, I promise!Download here.
Unreleased. Used as a first live version. The code was extended since, overwriting the original file.