Skip to content

category_meta plugin is broken with Pelican 3.7.1 #855

@jaredandrews

Description

@jaredandrews

Hi everyone,

The category_meta plugin is broken in Pelican 3.7.1.

There are two problems causing issues. I have documented them and the "solutions" for these issues in this repo: https://github.com/jaredandrews/pelican_category_meta_problems

#846 references a part of this issue but I figured I could help out by providing more thorough documentation.

Issue 1: category_meta fails to do anything when the index file doesn't have a date
When I build the site with make html I see:

ERROR: Skipping category/index.md: could not find information about 'date'
ERROR: No category assignment for ~/pelican_category_meta_problems/content/category/post.md (~/pelican_category_meta_problems/content/category/post.md)

When I go to the category.html page the category.description variable provided by category_meta is empty.

Solution: Added a date to my category index file. This is neither specified by the documentation of category_meta nor does it really make sense. I suspect at one point Pelican did not require articles it reads to have dates.

You can see this issue in action by checking out jaredandrews/pelican_category_meta_problems@859278b

Issue 2: category_meta causes an AttributeError
After adding a date to the category index file and running make html I get the following:

CRITICAL: AttributeError: can't set attribute

This is caused by line 73 in category_meta.py:

category.slug = slug

Presumably category.slug could be changed in previous versions of Pelican.

You can see this issue in action by checking out jaredandrews/pelican_category_meta_problems@62dac28

If I remove line 73 from category_meta.py, make html works and the category description is is provided by the plugin.

You can see the plugin working again by checking out jaredandrews/pelican_category_meta_problems@a99f9a6

I'm not 100% certain of the author of category_meta's intentions, but presumably removing this line to "fix" the plugin causes a loss of functionality.

I would love to help fix this issue but I am not very familiar with the Pelican code base nor am I 100% sure with what the category_meta author was trying to achieve with the slug assignment above.

Is there a way to reassign a categories slug in Pelican 3.7.1?

I don't know the answer to this question nor do I know why this would have been removed. I hope this documentation can help someone who does know :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions