Skip to content

Get RSS pubDate from mtimes #517

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sneakers-the-rat
Copy link
Contributor

Fixes: #507

Taking the idea from @stefmolin , here we get the pubDate from the mtime of the file. In CI we restore those from the commit history.

There is a minor bit of semantic mismatch between the RSS feed/RSS spec and what we might want for the site - the RSS field is pubDate, or the date that the item was published. I don't think the spec is prescriptive about what that means, e.g. updating a file could be re-publishing it (that's how we treat it here). Usually it's good to treat the original publication date and the update date separately when displaying: e.g. "Originally published: 2020-01-01, updated: 2025-06-04" since both of those are independently meaningful for a reader. Currently we don't display the date on the site, but i renamed the parameter to date_updated in case we want to add that in the future.

You'll notice that all the dates for the tutorials are shortly before right now, since that's the last time they were changed (to remove the dates). That may or may not be desirable... so i also made it possible to explicitly assign those dates if we wanted to backdate the existing tutorials, for example.

@sneakers-the-rat
Copy link
Contributor Author

While we're touching this, we may want to fix this...

description: str = "Tutorials for learning python i guess!!!"

@sneakers-the-rat sneakers-the-rat marked this pull request as ready for review June 5, 2025 01:33
@@ -61,7 +72,7 @@ class RSSFeed:
title: str = "pyOpenSci Tutorials"
link: str = "https://www.pyopensci.org/python-package-guide/tutorials/intro.html"
self_link: str = "https://www.pyopensci.org/python-package-guide/tutorials.rss"
description: str = "Tutorials for learning python i guess!!!"
description: str = "A tutorial feed that lists metadata for the pyOpenSci Python packaging tutorials so we can automatically list them on our website."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've gotcha @sneakers-the-rat updated this.

Copy link
Member

@lwasser lwasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome! Let's merge it! Thank you as always, @sneakers-the-rat !!! 🫶

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

Successfully merging this pull request may close these issues.

Markdown metadata for date field is all in 1970
2 participants