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

Getting an articles_paginator in template different to index.html #3399

Open
2 tasks done
jsandovalcardona opened this issue Oct 1, 2024 · 3 comments
Open
2 tasks done
Labels

Comments

@jsandovalcardona
Copy link

  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Question

I created my simple site using pelican. I have a page for index that's not listing the articles in my blog, so, pagination is not required there.

I have a different url, blog.html to list my articles. But, from there, I cannot access the articles_paginator.

In Pelican, how can I create a page different to index.html with access to the articles_paginator?

I'm using Pelican 4.9.1.

@avaris
Copy link
Member

avaris commented Oct 3, 2024

See DIRECT_TEMPLATES and PAGINATED_TEMPLATES documentation. In your case, it would be:

DIRECT_TEMPLATES = ['index', 'authors', 'categories', 'tags', 'archives', 'blog']
PAGINATED_TEMPLATES = {'index': None, 'tag': None, 'category': None, 'author': None, 'blog': None}

or this could be also relevant.

@jsandovalcardona
Copy link
Author

Thank you very much for your kind response. I almost had it as you indicate it. The problem I'm actually having is having access to the paginator in the template.

Some templates I've checked has a reference in the templates named articles_paginator. For example: https://github.com/getpelican/pelican/blob/main/pelican/themes/simple/templates/pagination.html

But, following that pattern results in a articles_paginator not defined; failing the generation of the site. What would be the name of the paginator in the blog page?

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

No branches or pull requests

3 participants
@avaris @jsandovalcardona and others