postlist excerpts ignores post excerpt length of 0

Open
#317 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Start from the postlist directive and its handling of the :excerpts: option, then trace how the post directive's :excerpt: 0 value is passed through. Reproduce the behavior with the provided post and postlist examples using ABlog 0.11.12; done means a post with excerpt length 0 does not display an excerpt in postlist.

Written by the indexing model from the issue text.

Description

Describe the bug

Apparently postlist ignores the length of the except being set to 0 in post.

In my case, this was quite the headscratcher, because the first paragraph was very long, so setting excerpt to 1 didn't make it smaller and setting it to 0 didn't make it smaller either.

I guess this is undefined behaviour? Since We tell postlist to show excerpts, but at the same time the post itself specifies that there should be no excerpt.
I would argue though, that someone disabling excerpts for a single post should take precedence over enabling them for everything.

To Reproduce

Set the excerpt length to 0 in a post:

.. post:: 2025-11-22
   :excerpt: 0

Get the post using postlist:

.. postlist:: 5
   :list-style: circle
   :format: {date} {title}
   :date: %Y-%m-%d
   :excerpts:
Screenshots

No response

System Details

ABlog version 0.11.12

Installation method

pip

Dominant language
Python
Stars
196
Forks
64
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sunpy/ablog

All issues in sunpy/ablog

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.