Skip to content

Conversation

@jbolns
Copy link
Contributor

@jbolns jbolns commented Jul 25, 2025

PR adds:

  • RSS combining blogs and grants, preliminarily limited to the last 20 entries,
  • Sitemap.

The first commit is unlikely ready for merging. There is an existing RSS for blogs only. It is necessary to decide first if to keep it like that (2 RSS feeds, one for blogs, one combining blogs and grants) or use only the combined version.

Closes #49

@cosenal . Adding sitemap here since you need it anyway and the two things typically go hand in hand.

@vercel
Copy link

vercel bot commented Jul 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
unitary-fund-prel Ready Ready Preview Sep 12, 2025 11:47am

@jbolns
Copy link
Contributor Author

jbolns commented Jul 25, 2025

Forgot to add the slugs for the different outputs:

  • /sitemap-index.xml
  • /sitemap-0.xml
  • /rss.xml

Sitemaps do not show on dev version. But they can be checked locally with pnpm astro build & pnpm astro preview

@cosenal cosenal requested a review from Copilot August 3, 2025 15:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds RSS feed and sitemap functionality to the Unitary Foundation website. The RSS feed combines both blog posts and grants into a single feed, while the sitemap provides better SEO and discoverability.

Key changes:

  • Creates a combined RSS feed that includes both blog posts and grants, limited to the last 20 entries
  • Adds sitemap generation with filtering to exclude test and image pages
  • Updates the layout to include links to both the new RSS feed and sitemap

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/pages/rss.xml.ts New RSS feed implementation combining blog posts and grants
src/layouts/Layout.astro Adds RSS and sitemap links to the HTML head section
package.json Adds @astrojs/sitemap dependency
astro.config.mjs Configures sitemap integration with page filtering
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

src/pages/rss.xml.ts:21

  • Variable name 'combined_items' uses snake_case which is inconsistent with JavaScript naming conventions. Consider using camelCase: 'combinedItems'.
  const combined_items: RSSItem[] = []

Copy link
Contributor

@cosenal cosenal left a comment

Choose a reason for hiding this comment

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

Imho we should keep the two feeds (blog posts and grants) separated, and the first one already exists.

astro.config.mjs Outdated
react(),
dotHtmlRedirects(),
sitemap({
filter: (page) => page !== 'https://unitary.foundation/test/' &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we can remove the test page all together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed locally. Will run some tests for this and other commits from suggestions ^and push updated version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed.

Individual slugs for RSS grant entries. Copilot recommendation.

Co-authored-by: Copilot <[email protected]>
Use constant for `allowedHtmlTags`. Copilot recommendation.

Co-authored-by: Copilot <[email protected]>
@jbolns
Copy link
Contributor Author

jbolns commented Aug 5, 2025

Yeah, leaving previously existing RSS in place seems wisest. At the very least, it won't break the feed of anyone already using it.
Reviewed all recommendations by Copilot. Pushed a slightly edited version that avoids type warnings in rss.xml.ts.
It works on my computer, haha!

@cosenal
Copy link
Contributor

cosenal commented Aug 6, 2025

@jbolns Once it's ready for a re-review, let me know 🙏

@jbolns
Copy link
Contributor Author

jbolns commented Aug 6, 2025

Oops. Yup, ready for re-review, I think. @cosenal

@cosenal
Copy link
Contributor

cosenal commented Aug 6, 2025

@jbolns fyi, next time you can use the button to «Re-request review» when it's ready

@jbolns
Copy link
Contributor Author

jbolns commented Aug 6, 2025

Sorry, sorry, I always forget about those buttons. Goldfish memory. 😄
But I'll do my best.

@jbolns jbolns requested a review from cosenal August 6, 2025 15:26
@jbolns
Copy link
Contributor Author

jbolns commented Sep 9, 2025

:)

@cosenal
Copy link
Contributor

cosenal commented Sep 10, 2025

What we discussed in the comments of this PR was to have two separate feeds, one for posts, the other for grants.

Instead, what I see here now is:

  1. the old feed only for posts (in src/pages/posts/feed.xml.ts) – which we don't want to break
  2. a new feed combined posts + grants (in src/pages/rss.xml.ts)

What we want instead of 2) is simply something like 1), but for grants (possibly in src/pages/grants/feed.xml.ts.)

@jbolns
Copy link
Contributor Author

jbolns commented Sep 10, 2025

Apologies, I misunderstood, probably due to cognitive dissonance as I thought the issue was still open after so long specifically because the schema operations required for a combined feed are tricky.

I'll make the adjustments later today or tomorrow and resubmit.

@cosenal
Copy link
Contributor

cosenal commented Sep 10, 2025

Apologies, I misunderstood, probably due to cognitive dissonance as I thought the issue was still open after so long specifically because the schema operations required for a combined feed are tricky.

I'll make the adjustments later today or tomorrow and resubmit.

No worries. Before making the changes, let me know if the requirements are all clear now.

@jbolns
Copy link
Contributor Author

jbolns commented Sep 10, 2025

I think they are. Basically, the same as blog, but with a different collection, i.e., grants, and ideally located in the grants folder rather than at the root.

But... at the risk of coming across as slightly petulant, are you sure?

You do not publish grants as frequently as needed for a fully independent grants feed.

@cosenal
Copy link
Contributor

cosenal commented Sep 10, 2025

But... at the risk of coming across as slightly petulant, are you sure?

For now, yes.

  1. we don't want to support two feeds, the way the PR it is now
  2. the Grant items are not rich enough to be presentable in a combined feed.

This is how the feed from your PR looks like:
Screenshot 2025-09-10 at 14 34 21

If that's in a separate grant feed, at least it's clear what it is about.
Once we will have reacher grant item, we can combine the two.

@jbolns
Copy link
Contributor Author

jbolns commented Sep 10, 2025

Fair enough. Will try and push tomorrow.

@jbolns
Copy link
Contributor Author

jbolns commented Sep 12, 2025

Done, I think.

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.

Add RSS feed to grants

2 participants