Skip to content

Commit

Permalink
chore: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jul 6, 2023
1 parent 74a5a45 commit 58e1015
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.

## Features

- 📦 Single or MultiSitemaps
- 📦 Single and Multi Sitemap support
- 🤝 Integrates seamlessly with Nuxt I18n and Nuxt Content
- 🤖 Dynamic runtime URL support with caching by default
- 🎨 Styled XML for easier debugging
- 😌 Automatic `lastmod` and image discovery
- 🔄 Route config using route rules
- 🏞️ Best practice URLs: canonical with trailing slashes
- 🏞️ Best practice URLs: canonical with consistent trailing slashes


## Installation
Expand Down
12 changes: 12 additions & 0 deletions test/changeApiUrl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ describe('base', () => {
expect(posts).toMatchInlineSnapshot(`
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><?xml-stylesheet type=\\"text/xsl\\" href=\\"/base/__sitemap__/style.xsl\\"?>
<urlset xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns:video=\\"http://www.google.com/schemas/sitemap-video/1.1\\" xmlns:xhtml=\\"http://www.w3.org/1999/xhtml\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\" xsi:schemaLocation=\\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd\\" xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\">
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/base/fr/blog\\" />
<loc>https://nuxtseo.com/base/blog</loc>
</url>
<url>
<loc>https://nuxtseo.com/base/blog/1</loc>
</url>
Expand All @@ -36,6 +40,14 @@ describe('base', () => {
<url>
<loc>https://nuxtseo.com/base/blog/3</loc>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/base/fr/blog/tags\\" />
<loc>https://nuxtseo.com/base/blog/tags</loc>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/base/fr/blog/categories\\" />
<loc>https://nuxtseo.com/base/blog/categories</loc>
</url>
</urlset>
<!-- XML Sitemap generated by Nuxt Simple Sitemap -->"
`)
Expand Down
32 changes: 28 additions & 4 deletions test/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ describe('i18n', () => {
expect(posts).toMatchInlineSnapshot(`
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><?xml-stylesheet type=\\"text/xsl\\" href=\\"/__sitemap__/style.xsl\\"?>
<urlset xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns:video=\\"http://www.google.com/schemas/sitemap-video/1.1\\" xmlns:xhtml=\\"http://www.w3.org/1999/xhtml\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\" xsi:schemaLocation=\\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd\\" xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\">
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog\\" />
<loc>https://nuxtseo.com/blog</loc>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog/tags\\" />
<loc>https://nuxtseo.com/blog/tags</loc>
</url>
<url>
<loc>https://nuxtseo.com/blog/post-1</loc>
</url>
Expand All @@ -68,6 +76,10 @@ describe('i18n', () => {
<url>
<loc>https://nuxtseo.com/blog/post-5</loc>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog/categories\\" />
<loc>https://nuxtseo.com/blog/categories</loc>
</url>
</urlset>
<!-- XML Sitemap generated by Nuxt Simple Sitemap -->"
`)
Expand All @@ -76,10 +88,16 @@ describe('i18n', () => {
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><?xml-stylesheet type=\\"text/xsl\\" href=\\"/__sitemap__/style.xsl\\"?>
<urlset xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns:video=\\"http://www.google.com/schemas/sitemap-video/1.1\\" xmlns:xhtml=\\"http://www.w3.org/1999/xhtml\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\" xsi:schemaLocation=\\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd\\" xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\">
<url>
<loc>https://nuxtseo.com/about</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr\\" />
<loc>https://nuxtseo.com/</loc>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/a-propos\\" />
<xhtml:link rel=\\"alternate\\" href=\\"https://nuxtseo.com/fr/about\\" hreflang=\\"fr\\" />
<loc>https://nuxtseo.com/about</loc>
<changefreq>daily</changefreq>
<priority>0.3</priority>
<image:image>
<image:loc>https://nuxtseo.com/image.jpg</image:loc>
</image:image>
Expand All @@ -89,8 +107,10 @@ describe('i18n', () => {
<image:image>
<image:loc>https://nuxtseo.com/image-3.jpg</image:loc>
</image:image>
<changefreq>daily</changefreq>
<priority>0.3</priority>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/new-page\\" />
<loc>https://nuxtseo.com/new-page</loc>
</url>
<url>
<loc>https://nuxtseo.com/services</loc>
Expand All @@ -117,6 +137,10 @@ describe('i18n', () => {
<loc>https://nuxtseo.com/services/development/app</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/offres/developement/app\\" />
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/hidden-path-but-in-sitemap\\" />
<loc>https://nuxtseo.com/hidden-path-but-in-sitemap</loc>
</url>
<url>
<loc>https://nuxtseo.com/services/development/website</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/offres/developement/site-web\\" />
Expand Down
12 changes: 12 additions & 0 deletions test/prod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ describe('prod', () => {
expect(await $fetch('/posts-sitemap.xml')).toMatchInlineSnapshot(`
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><?xml-stylesheet type=\\"text/xsl\\" href=\\"/__sitemap__/style.xsl\\"?>
<urlset xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns:video=\\"http://www.google.com/schemas/sitemap-video/1.1\\" xmlns:xhtml=\\"http://www.w3.org/1999/xhtml\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\" xsi:schemaLocation=\\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd\\" xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\">
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog\\" />
<loc>https://nuxtseo.com/blog</loc>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog/tags\\" />
<loc>https://nuxtseo.com/blog/tags</loc>
</url>
<url>
<loc>https://nuxtseo.com/blog/post-1</loc>
</url>
Expand All @@ -54,6 +62,10 @@ describe('prod', () => {
<url>
<loc>https://nuxtseo.com/blog/post-5</loc>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog/categories\\" />
<loc>https://nuxtseo.com/blog/categories</loc>
</url>
</urlset>
<!-- XML Sitemap generated by Nuxt Simple Sitemap -->"
`)
Expand Down
40 changes: 25 additions & 15 deletions test/sitemapName.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ describe('sitemapName', () => {
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><?xml-stylesheet type=\\"text/xsl\\" href=\\"/__sitemap__/style.xsl\\"?>
<urlset xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns:video=\\"http://www.google.com/schemas/sitemap-video/1.1\\" xmlns:xhtml=\\"http://www.w3.org/1999/xhtml\\" xmlns:image=\\"http://www.google.com/schemas/sitemap-image/1.1\\" xsi:schemaLocation=\\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd\\" xmlns=\\"http://www.sitemaps.org/schemas/sitemap/0.9\\">
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr\\" />
<loc>https://nuxtseo.com/</loc>
<lastmod>2023-06-22T01:25:58+00:00</lastmod>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog\\" />
<loc>https://nuxtseo.com/blog</loc>
<lastmod>2023-04-28T18:08:42+00:00</lastmod>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/about\\" />
<loc>https://nuxtseo.com/about</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/a-propos\\" />
<lastmod>2023-02-20T21:50:52+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.3</priority>
Expand All @@ -37,8 +47,14 @@ describe('sitemapName', () => {
</image:image>
</url>
<url>
<loc>https://nuxtseo.com/services</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/offres\\" />
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/new-page\\" />
<loc>https://nuxtseo.com/new-page</loc>
<lastmod>2023-06-22T01:26:57+00:00</lastmod>
</url>
<url>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog/tags\\" />
<loc>https://nuxtseo.com/blog/tags</loc>
<lastmod>2023-04-28T18:08:42+00:00</lastmod>
</url>
<url>
<loc>https://nuxtseo.com/blog/post-1</loc>
Expand All @@ -65,20 +81,14 @@ describe('sitemapName', () => {
<loc>https://nuxtseo.com/users-lazy/3</loc>
</url>
<url>
<loc>https://nuxtseo.com/services/coaching</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/offres/formation\\" />
</url>
<url>
<loc>https://nuxtseo.com/services/development</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/offres/developement\\" />
</url>
<url>
<loc>https://nuxtseo.com/services/development/app</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/offres/developement/app\\" />
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/blog/categories\\" />
<loc>https://nuxtseo.com/blog/categories</loc>
<lastmod>2023-04-28T18:08:42+00:00</lastmod>
</url>
<url>
<loc>https://nuxtseo.com/services/development/website</loc>
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/offres/developement/site-web\\" />
<xhtml:link rel=\\"alternate\\" hreflang=\\"fr\\" href=\\"https://nuxtseo.com/fr/hidden-path-but-in-sitemap\\" />
<loc>https://nuxtseo.com/hidden-path-but-in-sitemap</loc>
<lastmod>2022-12-22T00:02:26+00:00</lastmod>
</url>
</urlset>
<!-- XML Sitemap generated by Nuxt Simple Sitemap -->"
Expand Down

0 comments on commit 58e1015

Please sign in to comment.