likhoblog
Updated 2026 May 02 by Likho (licho@firemail.cc)
likhoblog is a simple microblog generator
rebranded from microblog.py.
Download / Clone
https://git.32bit.cafe/likho/likhoblog
Install
python -m venv ./venv
source ./venv/bin/activate
pip install likhoblog-1.0.0-py3-none-any.whl
You don’t need a virtual environment if you don’t have an externally managed environment (Linux package manager).
Usage
likhoblog-init
likhoblog default.tpl content.txt > index.html
likhoblog-upload your_username
likhoblog-check
Sample Output
https://likho.neocities.org/microblog/
Why?
Features:
- pagination
- tag cloud
- webring
- configuration file
- sorting (backdating)
- mini-galleries
- rss feed
Perks over social media platforms.
- less drama
- not “software-as-a-service”
- self-stewardship of data
- no moderator abuse
- no data mining = no popularity & engagement metrics
- no click/ragebait
- no “headline-of-the-day then forget 2 weeks later”
- viewable on older computers and browsers
- low requirements
- doesn’t get invoked each visit (unlike f/CGI)
- doesn’t need to be run 24/7 (unlike web server application)
- doesn’t involve a relational database system
- doesn’t need javascript
Configuration
content.txt– write your blog heresettings.tomlis the configuration filetemplate.tplis the html page templatetimeline.cssis the style sheet that defines the layout and proportions of page elements; by default, it minimally defines color.
To help discern which elements are which, some borders in
index.html are color-coded in red, blue, and
green.
Posting images
See accepted_images under [post] in
settings.toml.
Default:
accepted_images= ["jpg", "JPG", "png", "PNG"]
For example if content.txt contains the
following
Thu Mar 16 2:22:22 PM EDT 2022
I took these pictures.
/images/1.jpg /images/2.jpg /images/3.jpg
The images will be rendered within the gallery and panel elements as
<a href="/images/1.jpg"><img src="/images/1.jpg" class="embed"></a>
and so on.
However, this is okay for images of small sizes such as
screenshots of old cartoons, books, or web pages. Note, relative
paths (e.g ./images/1.jpg) may break on paginated
posts or tags.
Images with Thumbnails
See [post.gallery] in settings.toml.
likhoblog requires a thumbnail image and the
full-sized image to be of the same name but in different
folders; however, the program does not manage images for
the user.
An example:
Thu Mar 16 2:22:22 PM EDT 2022
I took these pictures.
1.jpg 2.jpg 3.jpg
If there is no symbol such as ‘.’ or ‘/’ that specifies a directory, a path based on user preferences will be prepended to the image file names, presumably for thumbnail and full-sized images.
Other Notes
likhoblog does not manage or resize images for
the user.
The functionality can be added as a make recipe.
Given three folders, import (contains new, raw, or
uncompressed images), images and
thumbs,
# for each images in import
# resize to 720p or 140p and put it in a folder
SOURCE=$(shell ls import)
TOOL=magick
images:
for image in $(SOURCE) ; do \
$(TOOL) import/$$image -resize 1280x720 images/$$image;\
$(TOOL) import/$$image -resize 256x140 thumbs/$$image;\
done
Enable webring
See [webring] in settings.toml.
Webring is disabled by default in settings.toml.
It can be enabled by setting false to
true.
Adding to webring
The followers list is an array of strings.
list= ["https://likho.neocities.org/microblog/meta.json"]
An array can also be broken into multiple lines.
list = [
"https://likho.neocities.org/microblog/meta.json",
"https://somewhere.else/microblog/meta.json"
]
See https://toml.io/en/v1.0.0#array for acceptable syntax.
You can add someone on an alternate DNS root like OpenNIC as long as your computer resolves the URL. Just don’t expect that same URL to resolve for everyone else visiting your page.
HTML Detection
See inline_tags under [post] in
settings.toml.
Default:
inline_tags = ["i", "em", "b", "strong","u", "s", "a", "span"]
Multiple lines of HTML can be included in notes without triggering automatic markup.
A few caveats:
- attributes in
<pre>and<code>are not supported - unpaired tags must end with “/>” (e.g
<img src="image.jpg"/>)
Good Practice
Keep content simple and maintainable.
Sat Nov 25 10:19:03 AM PST 2023
Test code block
<div style="overflow-x:scroll">
<pre>
<code>
#include <stdio.h>
int main(void) {
printf("Hello world! I am a C program.\n");
return 0;
}
</code>
</pre>
</div>
In this example, a code block has a long sentence which may
trail off to the sides on phones or other small devices.
overflow-x adds a horizontal scroll bar so all text
remains within its containers. Ideally, don’t use
<div> or <span> unless
necessary. In most cases, overflow-x:scroll is good
enough.
Not Recommended
The following may lead to bad results, more effort than necessary, or unmaintainability of the microblog or website. Generally, anything complex or fancy is better off as its own blog or page.
- any tags for headers such as h1, h2, or so on
- css rules to select specific posts within the microblog
- using the attribute “style” to define colors
Disclosures
The project uses pycurl and urllib for web requests.
likhoblog-upload, to upload files in bulk to
neocities, handles password using getpass.1
likhoblog uses GET requests to fetch data. No
other types of HTTP/S requests are made.2
Proxy Behavior
likhoblog supports proxied connections.
Tor support can be enabled by setting either environment variables.
http_proxy=socks://127.0.0.1:9050https_proxy=socks://127.0.0.1:9050
As a result, the full script invocation will look like:
https_proxy=socks://127.0.0.1:9050 likhoblog
The proxy resolves domain regardless of whether
socks:// or socks5h://is
specified.
Common Errors
A key may be missing from your settings file (KeyError)
This most likely occurs after an update that added new
configuration options. The differences between the reference
settings.toml and a user copy can be reviewed by
the following command.
likhoblog-check