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

Add RSS feed #379

Merged
merged 8 commits into from
Jan 13, 2025
Merged

Add RSS feed #379

merged 8 commits into from
Jan 13, 2025

Conversation

martgnz
Copy link
Contributor

@martgnz martgnz commented Jan 7, 2025

Adds a RSS feed with the full content, which was dropped recently when the site got moved to Astro.

This PR will create a feed on https://maplibre.org/news/index.xml, which was the location of the old feed, I believe, to avoid breaking links. I had to make a dynamic route with only the feed otherwise it returned a 404 since the xml path was matching the .astro dynamic route.

This uses the new Astro Container API, with an approach similar to https://blog.damato.design/posts/astro-rss-mdx/.

I also added RSS icons on blog index and footer:

imagen imagen

Testing

If you want to test you can use NetNewsWire and point a new feed to the localhost Astro URL. The images won't work locally due to the Astro asset pipeline but they should appear on the built website. If you run npm run build and inspect dist/rss.xml you will see them referenced correctly.

imagen

Comment on lines +1 to +3
export const SITE_TITLE = "MapLibre";
export const SITE_DESCRIPTION =
"The MapLibre Organization is an umbrella for open-source mapping libraries.";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw this on src/pages/index.astro and didn't want to repeat it elsewhere since it's also needed on the RSS feed. I moved the string here. Feel free to move somewhere else or do it differently.

@@ -7,4 +7,10 @@ export default defineConfig({
base: "",
integrations: [mdx(), solidJs()],
output: "static",
site: "https://maplibre.org/",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

noting that this is also needed in a few places by the RSS feed, could look at another approach if you'd prefer.

height="16"
><path
fill="#fff"
d="M2.002 2.725a.75.75 0 0 1 .797-.699C8.79 2.42 13.58 7.21 13.974 13.201a.75.75 0 0 1-1.497.098 10.502 10.502 0 0 0-9.776-9.776.747.747 0 0 1-.7-.798ZM2.84 7.05h-.002a7.002 7.002 0 0 1 6.113 6.111.75.75 0 0 1-1.49.178 5.503 5.503 0 0 0-4.8-4.8.75.75 0 0 1 .179-1.489ZM2 13a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z"
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the SVG duplicated? Can it be stored in a css file or something?

Copy link
Contributor Author

@martgnz martgnz Jan 7, 2025

Choose a reason for hiding this comment

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

Yeah this icon was duplicated, just fixed. Other icons on the footer didn't have a file so I didn't want to break the consistency. I'll raise another PR moving them too to SVG.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I raised #380 which does the same pattern for the other footer icons.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've merged the other PR, thanks!
I'll leave this one to someone else...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great, this is now synced with main too, thanks for your suggestion!

@HarelM
Copy link
Collaborator

HarelM commented Jan 7, 2025

I've added a few minor comments, but I don't understand Astro enough to fully understand how this will work and this PR.
I'll leave it to someone else to review.

@louwers louwers requested a review from birkskyum January 9, 2025 22:42
Copy link
Member

@birkskyum birkskyum left a comment

Choose a reason for hiding this comment

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

Thanks! It looks correct to me. Let's see if it works as expected.

@birkskyum birkskyum merged commit 0230e11 into maplibre:main Jan 13, 2025
1 check passed
@birkskyum
Copy link
Member

birkskyum commented Jan 13, 2025

@martgnz , I tried a bit with "Feedly" , I'm not sure if I'm picking up the old or the new RSS feed. Can you help figure out if it's working as you expect it to? Also, to make sure if content is cropped, like if the entire posts are included in the feed.

I'm seeing this:
Screenshot 2025-01-13 at 16 03 31
Screenshot 2025-01-13 at 16 01 27

@martgnz
Copy link
Contributor Author

martgnz commented Jan 14, 2025

@birkskyum I tried with Feedly and your screenshot does show the old feed, which seems to be cached somehow. If you add a new feed and enter the HTTP address http://maplibre.org/news/index.xml you'll see this new feed which includes the full content. I'm not sure why this is happening, it seems like a problem on Feedly's end.

We could move the RSS address (https://groups.google.com/g/feedly-cloud/c/3evZeYOnS2I, https://groups.google.com/g/feedly-cloud/c/ZsUe_D5H43Q). I followed the same old address because it seemed like a good idea and I don't like breaking URLs if it can be avoided. We could wait it out as well.

On NetNewsWire the feed works correctly without problems.

@martgnz martgnz deleted the rss-feed branch January 14, 2025 01:51
@birkskyum
Copy link
Member

birkskyum commented Jan 14, 2025

This app works great. I'll contact Feedly to see if we can clear this cache.

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.

3 participants