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

For pelican 4, tags and categories |format must be updated to 'slug=' #21

Open
iranzo opened this issue Dec 12, 2018 · 4 comments
Open

Comments

@iranzo
Copy link

iranzo commented Dec 12, 2018

Hi,
With Pelican 4, templates/base will traceback because new format requires:

format(slug=$PREVIOUSTEXT) for both categories and tags rss/atom feed

Regards,
Pablo

@iranzo
Copy link
Author

iranzo commented Dec 12, 2018

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

@romunov
Copy link

romunov commented Jan 23, 2019

The release notes state that

For example, substitute TAG_FEED_ATOM|format(tag.slug) with TAG_FEED_ATOM.format(slug=tag.slug).

That being said, this does not work for me. I get CRITICAL: UndefinedError: 'tag' is undefined error.

@iranzo
Copy link
Author

iranzo commented Jan 23, 2019

I'm using pelican 4 and it renders properly:

themes/nest/templates/base.html:        {% if TAG_FEED_ATOM and tag %}
themes/nest/templates/base.html:        <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(slug=tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
themes/nest/templates/base.html:        {% if TAG_FEED_RSS and tag %}
themes/nest/templates/base.html:        <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(slug=tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />

@romunov
Copy link

romunov commented Jan 24, 2019

No doubt I'm doing something wrong. I'll try your approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants