Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate sitemap with react router

I'm trying to figure out how to dynamically generate sitemap in reactJS server side (express) web app. I'm using react router.

like image 827
Jan Omacka Avatar asked May 04 '16 07:05

Jan Omacka


People also ask

How do Sitemaps work?

A sitemap tells Google which pages and files you think are important in your site, and also provides valuable information about these files. For example, when the page was last updated and any alternate language versions of the page.

What is react router with example?

ReactJS Router is mainly used for developing Single Page Web Applications. React Router is used to define multiple routes in the application. When a user types a specific URL into the browser, and if this URL path matches any 'route' inside the router file, the user will be redirected to that particular route.


1 Answers

For simple ReactJS sitemap integration with React Router, you should check out the react-router-sitemap package.

It's fairly configurable as well, as you can see in the docs, so if you need to include change frequency or things like that, you should be able to do it no problem.

Or were you looking for a way to implement one yourself?

like image 90
samcorcos Avatar answered Sep 28 '22 12:09

samcorcos