Running a personal website should be an easy task. Unfortunately, a big hindrance is that there aren’t many “suckless” blogging system. blogit🔗 is the closest in terms of simplicity and minimalism to perfection. This article would be an end-all be-all guide to effectively install blogit onto your own website.
Installation
blogit advertises itself as a small static blog generator, and indeed the whole
project is comprised of a single script file. To install this file, first
navigate to your website’s git directory then wget
said script:
|
|
This might seem weird having a script in the home directory of your website, but I couldn’t find a better place to put it, especially when editing the actual script is dependent on each website’s setup (as seen later on).
blogit initializes the basic operational structure with the following command:
|
|
It is useful to let blogit build automatically on every git commit, so let’s configure that:
|
|
Then, open the blogit
script with a text editor, search for exclude
and delete the line where it outputs blog
to git exclude. This
functionality is meant for systems where the website’s root is not the same as
blogit’s root.
Configuration
blogit uses the file config
in $(website)
for its settings, so let’s create it:
|
|
To get the list of settings available, run:
|
|
For my use case, this is what I set it up as:
|
|
Everything should be self explainatory, except perhaps for BLOG_FEED*
.
BLOG_FEED_MAX
specifies the amount of rss and atom entries to generate,
whereas BLOG_FEEDS
specify feed formats to generate.
The script can be molded for each case, examples of doing this is explained later on.
Building, and the Tag System
Setting tags for each article is super easy in blogit. For every article, append this as a comment in the end of the file:
|
|
Finally, to build your blog:
|
|
Now you should be able to navigate to $(website)/blog/index.html
.
Congratz!
Miscellaneous
Because blogit is a very small script, we can easily edit it to make add features or to add complex styling functionality.
As done earlier, removing the git exclude is a basic recommended edit.
A more visible example is the order of HTML aggregation. For example, this
website has its article_list_header.html
coming before the tag list. The
article list header file includes the big “Articles” seen on the index
page🔗, which comes before the tag list. To do this you can edit
the blog/index.html:
section in the blogit script.
|
|
Fixing Code Blocks
I have noticed that when using backticks (`) to annotate a code block, blogit would add an extra newline at the start of each code piece. To solve this issue, ensure that you have the program command “markdown” which converts markdown to HTML. After that, substitute as following:
|
|
Conclusion
Go get a website🔗, and set up blogit. Want to contact me? Here.🔗