Giter Club home page Giter Club logo

Comments (2)

FredKSchott avatar FredKSchott commented on May 5, 2024

I really like this! Seems to really align nicely with the createCollection ideas that we already have. Some random thoughts:

  • Is combining many collections into a single RSS feed something that we want to support? I don't have a real-world example so can't really say how important that is to solve here vs. not worrying about it.

  • It would also be great to demo this on the snowpack.dev example directory. Could we add an RSS feed for news items?

  • Actually that brings up a good question: we aren't currently treating news items as a collection on the Snowpack.dev site. Obviously we could, but it feels a bit like boilerplate if the current "just load it in the component script" is working for us as users, since we plan to keep it all on a single page anyway.

What about something like import {createRSSFeed} from 'astro/runtime' that you could call anywhere? If that existed, could that function do everything and you just call it inside of createCollection()? That could nice from a flexibility standpoint, but obviously if there are blockers then migrating the News page of Snowpack.dev to use createCollection isn't the end of the world (from the point of view of a user).

from astro.

drwpow avatar drwpow commented on May 5, 2024

Is combining many collections into a single RSS feed something that we want to support?

I don‘t think so. The current plan was just to add multiple <link> tags to your site

It would also be great to demo this on the snowpack.dev example directory. Could we add an RSS feed for news items?

Yeah! That’d be a good test.

Actually that brings up a good question: we aren't currently treating news items as a collection on the Snowpack.dev site. Obviously we could, but it feels a bit like boilerplate if the current "just load it in the component script" is working for us as users, since we plan to keep it all on a single page anyway.

The nice part about Astro.fetchContent() is you can use that anywhere. If you don‘t need pagination, you don‘t have to use a collection.

What about something like import {createRSSFeed} from 'astro/runtime' that you could call anywhere? If that existed, could that function do everything and you just call it inside of createCollection()?

The original goal was just to save you having to load data in two places, but you do raise a good point: there‘s nothing specifically tying an RSS feed to a collection. I do think that “calling it anywhere” could introduce some complications, such as determining its final URL, can it be loaded from components, etc. and we’d have to throw a lot of errors if it‘s used unexpectedly. We could also start talking about the idea of non-HTML .astro components too (e.g. /rss.astro.xml)!

from astro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.