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

First pass at adding an atom feed #7

Merged
merged 2 commits into from Mar 14, 2024

Conversation

pipwilson
Copy link
Contributor

Steve Messer mentioned that he had tried to add a feed for the blog, but not quite got there. I thought I'd have a quick pass.

This is a naive implementation which was intended to be minimally invasive or overly implementation specific. It adds a feed for every _list.md, even ones where _list.md is the only file in a subdirectory of content.

It reuses the data created during publication of a list as its input - this means a feed should always match the relevant list page.

The only customisations I had to make were exposing the parent_path and a publish date to the template in order to get absolute URLs and make some of the feed values valid. It's possible that parent_path is passed to the template already but I couldn't see it.

I have not committed the generated changes to files in docs/ since I think the GitHub Action is supposed to do that, but they are all published correctly locally during a make render.

@stevenjmesser
Copy link
Contributor

stevenjmesser commented Mar 11, 2024

That’s really kind of you, thanks for contributing, @pipwilson! I’ll share this with the team so that we can get it reviewed.

@pipwilson
Copy link
Contributor Author

pipwilson commented Mar 11, 2024

It's the first time I've ever looked at this repo or used jinja, and several years since I last used Python, so I'm sure they'll suggest a better way forward, but it was fun :)

@colmjude
Copy link
Contributor

Thanks @pipwilson

I've made a couple of tweaks to the output to reduce the validation issues/warnings from https://validator.w3.org/feed/check.cgi.

There are still a couple more, but we can fix them over time. Going to merge now 👍

@colmjude colmjude merged commit 37b8c9d into digital-land:main Mar 14, 2024
@pipwilson
Copy link
Contributor Author

Ah that's great, thanks - I used the validator when I started but didn't check it again at the end. FWIW I blogged about this at https://philwilson.org/blog/2024/03/rss-for-fun-and-the-public-good/

@pipwilson pipwilson deleted the add-atom-feed branch March 14, 2024 10:17
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.

None yet

3 participants