question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

changefreq, priority, img options

See original GitHub issue

Hello , there’s any way of adding the frequency of change for the routes, priority or image with this module?

The sitemap package does something like this:

urls: [
        { url: '/page-1/',  changefreq: 'daily', priority: 0.3 },
        { url: '/page-2/',  changefreq: 'monthly',  priority: 0.7 },
        { url: '/page-3/'},    // changefreq: 'weekly',  priority: 0.5 
        { url: '/page-4/',   img: "http://urlTest.com" }
      ]

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
annmiroshcommented, Sep 14, 2019

This is my workaround for this case:

const router = require("../routes").default;
const Sitemap = require("react-router-sitemap").default;
const path = require("path");

function generateSitemap() {
  var mySitemap = new Sitemap(router()).build("https://mysite.com");
  for (let i = 0; i < mySitemap.sitemaps[0].urls.length; i++) {
    mySitemap.sitemaps[0].urls[i].changefreq =  'daily';
    mySitemap.sitemaps[0].urls[i].priority = 0.8;
  }

  mySitemap.save(path.basename(__dirname) + "/../sitemap.xml");
}

generateSitemap();

The generated xml contains changefreq and priority.

4reactions
buddies2705commented, Jun 4, 2020

Pass Date Object…

Example new Date() in lastmod … it works …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sitemap.XML – Why Changefreq & Priority Are Important
Your site should have a sitemap.xml and sitemap tags. Learn why changefreq and priority are an important best practice element to supply to...
Read more >
The Importance of The XML Sitemap Priority and Changefreq ...
When setting up an XML sitemap, you'll see two tags that may sound foreign to you: "priority" and "changefreq". We discuss their importance....
Read more >
XML Sitemap Priority & Sitemap Change Frequency - Slickplan
What is the meaning of XML sitemap priority, levels and change frequency (changefreq) and does it really matter to Google and your SEO?...
Read more >
Protocol - sitemaps.org
The priority of this URL relative to other URLs on your site. ... <lastmod>2004-12-23</lastmod> <changefreq>weekly</changefreq> </url> <url> ...
Read more >
Does <changefreq>and <image:title>have any apreciable ...
Particularly, im interested in these two: and**image:title** I've used them in a few ... and priority do not affect ranking of URL's once...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found