Utilize Ablog for blog operation#
It is useful to use Ablog when you want to operate it more like a blog than pure Sphinx functions.
What is Ablog?#
With the sphinx extension, you can manage articles in a blog-like format. If you set categories and tags, it is convenient to generate a list of articles based on them.
What you can do with Ablog#
Sort articles by category or tag
Automatic generation of article list
automatic archiving
sidebar support
Creating a draft article
Installing Ablog#
You can install it with pip or posery add and use it immediately by modifying conf.py a little. For details, refer to the official document
Article creation#
Create a blog folder and write articles in it. The file can be created manually or with ablog post new-post.
.. post:: 2025-03-27
:tags: sphinx, ablog
:category: python
新しい記事
================
これは新しい記事です。
List of articles#
If you write the following in index.rst, the latest 5 articles will be displayed.
.. postlist:: 5
:date: %Y/%m/%d
:format: {title} ({date})
:excerpts:
:expand: Read more ...
Other features#
automatic archiving#
Ablog is automatically archived during build. You can easily create a link to an archive page by writing something like the following:
- :ref:`タグ一覧 <blog-tags>`
- :ref:`カテゴリ一覧 <blog-categories>`
- :ref:`アーカイブ <blog-archives>`
Reference URL
sidebar support#
The sidebar can include a list of tags, a list of categories, and links to archives. In the case of this site, secondary_sidebar_items is set as follows.
html_theme_options = {
"secondary_sidebar_items": {
"**": [
"ablog/recentposts.html",
"ablog/tagcloud.html",
"ablog/categories.html",
"ablog/archives.html",
],
},
}
Reference URL
Creating a draft article#
If you set the date attribute of an article to a future date, the article will be treated as a draft. It is not displayed during build. Since sphinx is a static page, it will need to be rebuilt in the future.
Impressions#
I think I will be able to achieve my desire to use this as a basis for continuation so that I can keep daily study notes. Automatic organization of categories and tags, creation of draft articles, etc. seem to be useful. This is a great opportunity, so I would like to take this opportunity to continue blogging.
Article information
- Post date:
2025-04-01
- author:
Mr. Takagi