miller-productions / gatsby-plugin-podcast-feed-mdx

Gatsby plugin to generate a podcast rss feed that is published on your site.
MIT License
3 stars 3 forks source link

Multiple podcasts #3

Open lefnire opened 4 years ago

lefnire commented 4 years ago

gatsby-plugin-mdx allows multiple directories:

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `pages`,
        path: `${__dirname}/src/pages/`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `posts`,
        path: `${__dirname}/src/posts/`,
      },
    },
    {
      resolve: "gatsby-plugin-page-creator",
      options: {
        path: `${__dirname}/src/posts`,
      },
    },
  ],
}

I have two podcasts on the same page, and two feeds to generate. GPPFM doesn't seem to let you specify which directory will be used (via gatsby-plugin-mdx) for the feed. Is my intuition right that there's no multiple-podcast support currently? Should I submit a PR to provide this if I get around to it (ie, would you be interested in that)?

miller-productions commented 4 years ago

Interesting. What's the rough outline of how it would be built? i.e. what changes, where?

lefnire commented 4 years ago

I'm new to Gatsby, so forgive technical misunderstandings. My thought was feedOptions would allow path (like in gatsby-plugin-mdx) and don't use allMdx but a filtered subset. So you can have subdirectories for different podcasts /podcast1 /podcast2.

lefnire commented 4 years ago

I'm not sure if it's as simple as that with gatsby-plugin-mdx + gatsby-plugin-page-creator doing the legwork

miller-productions commented 4 years ago

Could be doable, first to check would be if, for a given podcast (e.g. /podcast1) you could filter the graphql query to grab only the mdx from that directory.

lefnire commented 4 years ago

Right, I think there are few ways (mostly looking at tutorial-seven. createNodeField from path to use as a filter in GraphQL like fields: { path: { eq: $path} }`. Or create a different node type, etc. But my hunch was that gatsby-plugin-mdx + gatsby-plugin-page-creator would do the legwork here, since that combo allows for multiple page directories with different basePaths.