pelican-themes icon indicating copy to clipboard operation
pelican-themes copied to clipboard

pelican-striped-html5up: TypeError: not all arguments converted during string formatting

Open Lx opened this issue 2 years ago • 0 comments

I was unable to render my site with the pelican-striped-html5up theme because of the following critical error:

CRITICAL TypeError: not all arguments converted during string formatting

Using pelican -D I tracked the source down to this portion of the head block (lines 19–21):

{% if CATEGORY_FEED_ATOM and category %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
{% endif %}

In all cases of category being truthy, category.slug is a simple string so I don't understand why the format call fails, but replacing:

{{ CATEGORY_FEED_ATOM|format(category.slug) }}

with

{{ CATEGORY_FEED_ATOM|format(slug=category.slug) }}

resolves the issue.

Lx avatar Mar 19 '22 09:03 Lx