Sitemap, RSS Feed, & Static Routes with Next.js App Router

Поділитися
Вставка
  • Опубліковано 25 січ 2025

КОМЕНТАРІ • 31

  • @colbyfayock
    @colbyfayock  5 місяців тому

    Learn how to build a full stack Next.js app in my upcoming course: colbyfayock.com/course

  • @patricksweet4104
    @patricksweet4104 Рік тому +1

    Wow, you're a huge help. Will be tuning in for all your Next.js videos. You're a great resource with so many devs currently switching/moving over to Next.

    • @colbyfayock
      @colbyfayock  Рік тому +1

      thanks! glad it helped

    • @patricksweet4104
      @patricksweet4104 Рік тому

      @@colbyfayock One quick thing---sorry for the bother.
      Something I am trying to solve that maybe you've seen before: programmatically including all the valid folders/routes in my Next.js app in my sitemap. (I am using v14 / the app router)
      I am trying to find some function that does this, but can't seem to find it.
      For example, I have an "about" folder/page and a "contact" folder/page. I'd rather not manually type these into the sitemap. Is there a way for Next.js v14 to get all of these routes to include when generating the sitemap?
      Thank you a ton.

    • @colbyfayock
      @colbyfayock  Рік тому +1

      @@patricksweet4104haven't seen an example but you could potentially see if it would allow you to scan the filesystem and list out the directories, but it wouldn't be a blanket solution for every use case

    • @patricksweet4104
      @patricksweet4104 Рік тому

      @@colbyfayock yep that is what I'm doing currently. Should do what I need for now. Thank you!

    • @patricksweet4104
      @patricksweet4104 Рік тому

      I am curious / unsure though---will file system scans work once it is deployed? Just wondering since it is technically the post-build version that would run that js to generate the sitemap.

  • @kevinurielfonseca
    @kevinurielfonseca 6 місяців тому +1

    Big thanks dude. I've been trying to implement this feature for the last two days and was not able to get it to work until I found this video. You just got a subscriber!

  • @OlivePigeon609
    @OlivePigeon609 Рік тому

    This helped me a lot when building my new blogsite using NextJS. Thanks for that man I hope you get more attention

  • @andyMutale
    @andyMutale Рік тому +1

    Criminally underrated

  • @tuanle-m7h
    @tuanle-m7h Рік тому

    I have a question, if my website has too large data (ex: Film website), and I have pagination (20 films/page). How should I write dynamic sitemap for it? Because if I get all films, I think it's a lot of time

  • @AvinashVagh
    @AvinashVagh Рік тому

    Great Colby, Thanks for sharing !

  • @colbyfayock
    @colbyfayock  Рік тому +1

    Get fresh tutorials and other free content straight to your inbox! colbyfayock.com/news

  • @mahdardavari3585
    @mahdardavari3585 11 місяців тому

    tnx for it, how can create sitemapindex in next and rss

    • @colbyfayock
      @colbyfayock  11 місяців тому

      np! check this out: nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap#generating-multiple-sitemaps

  • @abolfazleabolghasemi-cd7qy
    @abolfazleabolghasemi-cd7qy 5 місяців тому

    thanks for this , I need it.

  • @muhammadarsalanahmed5643
    @muhammadarsalanahmed5643 Рік тому

    Thanks for this valuable guide, Can you tell me how can I revalidate my sitemap.js? I have used fetch with next js revalidate in it but it doesn't revalidate it when a new page is added.

    • @colbyfayock
      @colbyfayock  Рік тому

      you're welcome! i would think it would only revalidate once the cache headers expire, not new content. i havent tried this with a route handler, but have you looked at on-demand revalidation? nextjs.org/docs/app/building-your-application/data-fetching/revalidating#on-demand-revalidation

  • @ameer6168
    @ameer6168 Рік тому

    is there any method to make nested dynamic sitemap i've more than 50k+ data

    • @colbyfayock
      @colbyfayock  Рік тому

      there's not quite yet a native way ot do that, but its on their list:
      > In the future, we will support multiple sitemaps and sitemap indexes.
      in the meantime youd likely need to manually create a route, kind of like we're doing with the RSS Feed, and create your own links to the other sitemaps based on your own rules for what data goes in which sitemap

  • @kamrant8915
    @kamrant8915 8 місяців тому

    Thank you very much

  • @SR-zi1pw
    @SR-zi1pw Рік тому +1

    Great tut