Skip to main content

A Pelican plugin providing “microblogging” capabilities.

PyPI version number Changelog Supported Python version License Download Count

Quickstart

  1. Install the plugin via pip: pip install minchin.pelican.readers.microblogging

  2. Generally, the plugin should be loaded and configured automatically without further effort on your part.

  3. Create a micro folder in your content folder (to hold your micro blog posts!).

  4. Create a new post in your micro folder. This can be generally be just the text (body) of your post. In terms of metadata, title is unneeded (and ignored), slug will be auto-generated (based on the post date), and date will determined from the file creation datetime of the post file. If you provide the date, it must be on the first line, in key: value format. The text body will be read as Markdown (so plain text effectively works too)!

  5. Regenerate your Pelican site!

Sample (Micro) Post File

<!-- ./content/micro/202307091701.md -->

date: 2023-07-09 17:01+0600

I'm microblogging with Pelican!
https://blog.minchin.ca/label/microblogging-pelican

Or a post with an image:

<!-- ./content/micro/202307112138.md -->

date: 2023-07-11 21:38-0600
image: images/birger-strahl-olI66vtMgNo-unsplash.jpg

Microblog posts can have "feature" images too! (URL of photo should
automatically be added.)

The image path is relative to your content folder. A URL of the photo is added to the end of the post as well.

Background Notes (on Micro Blogging)

Microblogging is here considered to be blog posts, but very short in length.

The most common example is Twitter, with an original limit of 140 characters (to be less than the SMS max of 160 characters). Twitter has since doubled their limit to 280 characters. The default on Mastodon is 500 characters, the same as (newly released) Threads. (Note that on Twitter, all links are run through a shortener and so are considered 23 characters long.) Here, the default soft limit is 140 characters. You can choose to ignore that, or set a higher limit (via MICROBLOG_MAX_LENGTH), but there are certain assumptions about presentation that start to fail as the posts get longer….

Installation

The easiest way to installed Microblogging is through pip:

pip install minchin.pelican.reader.microblog

Requirements

Microblogging relies on Pelican, and the autoloader plugin (for autoloading). If this plugin is installed from PyPI, these should automatically be installed.

if you need to insrall them manually:

pip install pelican
pip install minchin.pelican.plugins.autoloader

Additional Images

Micro blog post, using the Seafoam theme:

(Placeholder image for the moment…)

Replace Image...

Pelican Settings

These settings can be set in your pelicanconf.py file (your Pelican settings file) to alter the behavior of the plugin.

If a value is given below, this represents the effective default value. If no value is given, the effective default value is None.

Microblogging also auto-configures itself when possible. If you need to manually create the default configuration, you would need the following:

# pelicanconf.py

# if PLUGINS is not defined on Pelican 4.5+, these plugins will autoload
PLUGINS = [
    "minchin.pelican.readers.microblog",
    # others, as desired...
]

# the rest of the your configuration file...

This documentation has to be manually updated. If the settings no longer match the plugin’s behavior, or a setting is missing from here, please open a ticket on GitHub.

MICROBLOG_FOLDER = “micro”

Folder containing your micro blog posts, relative to your content root.

MICROBLOG_MAX_LENGTH = 140

How long should your micro blog posts ve limited to. Pelican will emit a warning if you exceed this.

MICROBLOG_SAVE_AS = ARTICLE_SAVE_AS

What to save the micro blog posts output file as. Defaults to using the same file structure as you are using for articles. c.f. MICROBLOG_URL.

MICROBLOG_SLUG = “u{date:%Y%m%d%H%M}”

The slug that will be used for micro blog posts. Eg. u202307091701.

Note that Pelican expects slugs to be universally unique.

MICROBLOG_URL = ARTICLE_URL

What URL to post the micro blog posts to. Defaults to using the same URL structure as you are using for articles. c.f. MICROBLOG_SAVE_AS.

Integration with Themes

For best support, you will need to modify your theme, or select a theme that already supports Microblogging, like my seafoam.

Some helpful notes:

  • Microblog posts are considered Articles by Pelican, and will be included in the articles and dates “lists”.

  • Microblog posts all have article.micro = True.

  • Microblog posts are added to the µ category.

  • Generally, you’ll want to disregard and now show the title of the microblog post. The title is set to the slug.

  • Because of their short length, it may make sense to display the whole body (article.content) in places that a link via the title of the article is typically shown.

Changelog

Changelog

Roadmap

These are features that I would like to eventually add to the plugin:

  • count links as 23 characters (à la Twitter)

  • process ReST microblog posts

  • CLI command to create microposts

  • add link previews

  • show (if applicable) that this is a reply to something (or a “re-tweet”)

  • show replies to each post (borrow the comment setup?)

  • automatically add hashtags as (Pelican) tags

  • [x] update Seafoam theme

  • [x] make sorting work for microblog posts

Known Issues

  • Processing relies on Pelican’s built-in Markdown reader.

  • The length of links to featured images will change if the SITE_URL changes. This can mean that the microblog post is “short” enough when reviewing your site locally, but not when the site is generated for publication.

Metadata

Release files for minchin.pelican.readers.microblog 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minchin.pelican.readers.microblog 1.0.0
File Size Uploaded
minchin.pelican.readers.microblog-1.0.0.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minchin.pelican.readers.microblog 1.0.0
File Interpreter ABI Platform
minchin.pelican.readers.microblog-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.3 kB

Release files / minchin.pelican.readers.microblog-1.0.0.tar.gz

Download URL minchin.pelican.readers.microblog-1.0.0.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
71533096e995195f00d8410222be7f3b96b7a01955fd2b4c3c5096ceb9546ba9
BLAKE2b-256 checksum
How to use checksums
c1714e9fef1f79b66fa1cbb2351bb0b0fb9253b13202bbd88f2d3e0f76546988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / minchin.pelican.readers.microblog-1.0.0-py3-none-any.whl

Download URL minchin.pelican.readers.microblog-1.0.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a7e81a806e2da35e7c243f6bb12b7080ad2a911e74df9a056936da9dcb3ce8f
BLAKE2b-256 checksum
How to use checksums
90f5b7e954af3a58bc8f99af3de75c6bea3d65d5fb6cdf063fec3e0f4dc9e770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page