How to generate sitemap with react router

后端 未结 3 1738
南笙
南笙 2020-12-05 23:30

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

3条回答
  •  自闭症患者
    2020-12-06 00:04

    If your site frequently changes, you need to dynamically create the sitemap. I was stuck here and found this effective solution, which can even generate a real time sitemap by calling API for my website in ReactJS, using NextJs. dynamic Sitemap Steps

    You can do this by creating most of the public files like

    1. sitemap.xml
    2. rss.feed
    3. robots.txt
    4. humans.txt

    That too with preserving the behaviour of ReactJS.

提交回复
热议问题