Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

category_meta plugin is broken with Pelican 3.7.1 #855

jaredandrews opened this issue Feb 8, 2017 · 4 comments

category_meta plugin is broken with Pelican 3.7.1 #855

jaredandrews opened this issue Feb 8, 2017 · 4 comments


Copy link

@jaredandrews jaredandrews commented Feb 8, 2017

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:

#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/ could not find information about 'date'
ERROR: No category assignment for ~/pelican_category_meta_problems/content/category/ (~/pelican_category_meta_problems/content/category/

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.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, 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 :)

Copy link

@jaredandrews jaredandrews commented Feb 8, 2017

I just discovered that replacing category.slug = slug with category._slug = slug fixes the issue. My understanding is that a variable prefixed with _ is supposed to be private so this change would be considered improper, yea?

Copy link

@manugarri manugarri commented Oct 8, 2017

@jaredandrews did you figure out a fix for this? I am not sure the Meta category plugin is actively maintained. Maybe submit a PR with your fix?

Copy link

@jaredandrews jaredandrews commented Dec 4, 2017

Hey @manugarri, thanks for the response. Sorry for the delay in getting back to you, I just discovered I had my GitHub notifications turned off!

Technically speaking, a fix exists in jaredandrews/pelican_category_meta_problems@a99f9a6

I'm just not totally confident that the changes I made don't break something else the original author of the plugin intended it to do (as outlined in my original post above).

For what it's worth, I have been using my modified version of the plugin on my website for almost nine months and it has been working great for my purposes. You can see the plugin in action along with a description of what I am using it for here:

I would be happy to clean up the code and make a pull request if that sounds good to you.


Copy link

@justinmayer justinmayer commented Mar 23, 2018

Hi @jaredandrews / @manugarri. Would you like to submit a PR to address the issue(s) you discussed here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants