nuxt-modules / sitemap

Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.
https://nuxtseo.com/sitemap
327 stars 29 forks source link

An invalid date was found. Please fix the date or formatting before resubmitting. #208

Closed cosbgn closed 9 months ago

cosbgn commented 9 months ago
image

Is generating something like this:

<url>
<loc>
https://example.com/blog/how-to-fix-this
</loc>
<lastmod>2024-01-08T00:00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
cosbgn commented 9 months ago

I use nuxt-content and set:

sitemap:
  loc: /blog/how-to-fix-this
  lastmod: 2024-01-08
  changefreq: monthly
  priority: 0.8

The format is correct, but the module then changes it.

Citingdude commented 9 months ago

I have the same issue, the module transforms the last mod date to an invalid format.

These are the 2 valid formats according to Google:

2005-02-21T18:00:15 is an invalid date, it needs the timezone to be valid.

https://developers.google.com/search/blog/2006/04/using-lastmod-attribute

harlan-zw commented 9 months ago

Thanks, looks like a big with the regex pattern matching. PRs welcome, otherwise will fix when I have a chance

PabloGBarcelo commented 9 months ago

I'll tackle this @harlan-zw

harlan-zw commented 9 months ago

Please try 5.0.2 :)