All Questions

Tools

Is there any tool available that generates site-maps by running the JS first?

I have tried https://www.xml-sitemaps.com/ but it only detects the index page…

author Tiago Ferreira

Reply
18 Answers

yeah the pros of using react… Or any CSR for that matter… Seriously, especially for SEO you should better use SSG or at least a hybrid approach

writen by Benedikt

what is SSG?

writen by Tiago Ferreira

Static Site Generation

writen by Benedikt

I am using gatsby but with react. So I am not really using the static site full potential

writen by Tiago Ferreira

Indeed. Reacts default is client side generation.

writen by Benedikt

<@U02U9TESZ6U>, <@U03G1DUCH47>, Bartolomeu Rodrigues any tips here?

writen by Tiago Ferreira

I use Next to leverage SSR and better SEO. It generates the site map for me . I don’t know if there’s a way to do for an SPA. But you use Gatbsy right? Use SSG

writen by Luca Restagno (ikoichi on Twitter)

Yeah, the combination of Gatsby (SSG) with React (SPA/CSR) seems a bit counterintuitive to me. But it might be relatively easy to switch to using Next from React

writen by Benedikt

Everyone keeps talking about next js. I will definitely use it in my next project

writen by Tiago Ferreira

<https//www.gatsbyjs.com/plugins/gatsby-plugin-sitemap/>

writen by Bartolomeu Rodrigues

At the end of the day everything is the same. I think gatsby has an excellent plugin ecossystem (like auto sitemaps) but fails with it’s GraphQL system. But you get stuff done. But ive been hearing tgat Supabase + Nextjs and Vercel can absolutely kill the need to have a traditional backend. You just access the database directly with supabase (and stop unintended changes with Row level security), and if you need endpoints, you just use Edge Functions or Api Routes from next

writen by Bartolomeu Rodrigues

I have tried the plugin but does not really work… How can it generate the sitemap without running the js? I guess I don’t really understand gatsby enough

writen by Tiago Ferreira

The plugin just reads the amount of pages that were generated.

Gatsby builds work by calculating the pages that you have or will need to be generated, and only after that it will build the JS and CSS and whatnot.

If you have pages that are not in the ‘pages’ directory and are not generated in ‘onCreatePages’, the gatsby plugin wont generate sitemaps for those

writen by Bartolomeu Rodrigues

But if you have pages that are only rendered in the users computer, and not rendered by gatsby and its defaults, you probably don’t need a sitemap for those pages.

Oh another thing, the gatsby plugin only generates sitemaps when you are building with gatsny build. Dev mode doesnt do anything

writen by Bartolomeu Rodrigues

Our product pages are generated client side with the info coming from the API. But still maybe there would be a way where Gatsby would render the JS and follow each link. But I guess it does not do that right?

writen by Tiago Ferreira

Nope. He just gathers all the needs for page generation, then he builds the JS and render. There is no traversal of links. If those product pages need SEO, they should be rendered using gatsby’s createPage, and not on the client side using what I assume is either reach router or react router

writen by Bartolomeu Rodrigues

<https//www.gatsbyjs.com/docs/programmatically-create-pages-from-data/>

writen by Bartolomeu Rodrigues

<https//www.gatsbyjs.com/docs/tutorial/part-6/>

writen by Bartolomeu Rodrigues

Do you want to ask a question?


Related Questions