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

Chronological article listing #2903

Closed
3 tasks done
GiovanH opened this issue Jul 12, 2021 · 6 comments
Closed
3 tasks done

Chronological article listing #2903

GiovanH opened this issue Jul 12, 2021 · 6 comments

Comments

@GiovanH
Copy link
Contributor

GiovanH commented Jul 12, 2021

  • 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.
  • I am willing to lend a hand to help implement this feature.

Feature Request

I would like to add index pages (tags, categories, all) that show posts in chronological order, instead of the default latest-first sort. ARTICLE_ORDER_BY is almost perfect for this, but it replaces the entire index, forcing you to choose one and only one sort order. What I want to do is add functionality without replacing any.

On tumblr, you can can browse a blog's tag in either order: chronological order or latest-first. The URL schemes look like this:

Default: https://{blog}.tumblr.com/tagged/{tag}/page/{i}
Chrono: https://{blog}.tumblr.com/tagged/{tag}/chrono/page/{i}

I've been trying to hack together a way to reproduce this without forking pelican, and have had no luck. This can't be done with pure template language (since pagination happens in pelican) and I haven't figured out a way to make an additional generator that's correct to the pelican ArticlesGenerator without duplicating code.

Essentially, this would just be generating index pages (tags, categories, etc) twice, once with a different order_by setting.

This could be an optional feature enabled with a setting. This shouldn't interfere with feed generation, which would respect ARTICLE_ORDER_BY.

@GiovanH
Copy link
Contributor Author

GiovanH commented Jul 12, 2021

It's definitely possible that this can be done with a pelican extension in a way that I'm not seeing. If that's the case and writing a generator for this is simple, this probably doesn't need to go in the main codebase.

@GiovanH
Copy link
Contributor Author

GiovanH commented Jul 12, 2021

Disregard, I've found a way to do this with standard extensions.

@GiovanH GiovanH closed this as completed Jul 12, 2021
@virtadpt
Copy link

https://xkcd.com/979/

@GiovanH
Copy link
Contributor Author

GiovanH commented Jul 12, 2021

https://xkcd.com/979/

Once I pack together a standard extension that does this I'll link it here! Heck, this is the sort of thing that it might sense to merge into pelican one day, once it exists.

@GiovanH
Copy link
Contributor Author

GiovanH commented Jul 13, 2021

Added an implementation at https://github.com/GiovanH/peliplugins/blob/master/chrono.py, see readme for details!

@virtadpt
Copy link

Nice!

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

No branches or pull requests

2 participants