@nuxtjs/sitemap 7.5.2 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +8 -2
  2. package/dist/content.d.mts +62 -39
  3. package/dist/content.d.ts +62 -39
  4. package/dist/content.mjs +68 -38
  5. package/dist/devtools/200.html +1 -0
  6. package/dist/devtools/404.html +1 -0
  7. package/dist/devtools/_fonts/4ppnHhMi-pBsWSPo7mY0avYxlDoAg1N3PTzCwXLZ5rA-d9oibkGnTd1JL3tc_xnaVgBLYmOB8kjrK2cvZaqwj9s.woff2 +0 -0
  8. package/dist/devtools/_fonts/4qBuU9MRVUlPZNPSF7Xom_sK8RBEnfYu-9VXFrdq8A8-8TDwLE1HAj1sQn7XxVWtM_7sIaPM-DTdO3Pf8U2DF1U.woff2 +0 -0
  9. package/dist/devtools/_fonts/6dYsbWUd_BpKJ7mdDihgOcya1gHXLpJBuMYXux3WMjE-q3fYNS8YbW5n7ZeXI2vSNgkRWW5VDPKAl51SNTjG2qk.woff2 +0 -0
  10. package/dist/devtools/_fonts/Lr-hqqZZsYmCt0ITUlr1CUrWim9fsKvoDFZliMxgNHY-iTa_Yt_PzhOY9TX7ZXdSlEPim6iRt92xhECwaxWxd5w.woff2 +0 -0
  11. package/dist/devtools/_fonts/OknHvWI6KtYn1JQBzX7eSpNDBQ8520F9TvSUJYkVf6A-xeZn9253svK_8Q2LD0XEruY_MnEsuCRO5LenPoggC0Y.woff2 +0 -0
  12. package/dist/devtools/_fonts/PV2hrQG6wq5BlIPDjdL1IcOflycaghyt5MHzlBqZtlo-lb_WexLz3VZqfTN0oi554iBH5tT2j2UFEV-XErCAS3E.woff2 +0 -0
  13. package/dist/devtools/_fonts/UA7OtwYHwGN_HjcVGTdmiQxUit7FlqkCwxVUWSeXVnQ-B4OXCFOL_tWrYODpQTc07aMaj0c2cewTOmBRWR9tD-A.woff2 +0 -0
  14. package/dist/devtools/_fonts/VE4cDVCv5MxbFM7ZLoLCGbIpNd71zhp7MDI9lmN5Y7I-xZyDYCUVrd6LV8eVGF3Um3UZjBFuUtDGtvdyTBBRYBo.woff2 +0 -0
  15. package/dist/devtools/_fonts/fVoGbnMbBFd5L9BBp9fUPavUSkZ_EmsQNSyadkT-108-U4T0khaeLQSIhtt9eVvaCEKJjtWJ4ioRJOf8hvqkWY0.woff2 +0 -0
  16. package/dist/devtools/_fonts/lQAxeCEs1R0Lw-H9XRU1RlOARQN8J6npRsPjyEDMe5s-_DUSLEkO3tKTuun_gSnDLoQPVEnpOnyqZMOw0ByZ6PA.woff2 +0 -0
  17. package/dist/devtools/_fonts/lntlqNHKLV2n82yTwMde70QqOjcfLE2XJ5oKZ3vRPWc-z6TxpIZQdWXztWLr9_OFWqt_WJJoeGtuK_-XQMZGQwE.woff2 +0 -0
  18. package/dist/devtools/_fonts/qxAYvKsXWeYv731eb-h5TRurcdIP_W44mpNdX-HABAk-zUDeMEFlNtNbrwvT9JxLEBg0TphGy70O6RfIoIX_ZwU.woff2 +0 -0
  19. package/dist/devtools/_nuxt/6-8YL5RT.js +1 -0
  20. package/dist/devtools/_nuxt/B-CoxLn7.js +1 -0
  21. package/dist/devtools/_nuxt/BBg_LgdD.js +1 -0
  22. package/dist/devtools/_nuxt/BFP26XjE.js +1 -0
  23. package/dist/devtools/_nuxt/BFxFqELk.js +1 -0
  24. package/dist/devtools/_nuxt/BJ46vUgN.js +22 -0
  25. package/dist/devtools/_nuxt/BK43-3Xm.js +1 -0
  26. package/dist/devtools/_nuxt/BUgp7PK5.js +1 -0
  27. package/dist/devtools/_nuxt/BUwCbG2W.js +1 -0
  28. package/dist/devtools/_nuxt/BgUkVPML.js +1 -0
  29. package/dist/devtools/_nuxt/Bl-ESRhh.js +1 -0
  30. package/dist/devtools/_nuxt/BpntLhpu.js +1 -0
  31. package/dist/devtools/_nuxt/CMkTWvG2.js +1 -0
  32. package/dist/devtools/_nuxt/CdSSkj0j.js +6 -0
  33. package/dist/devtools/_nuxt/Cfg7NvvP.js +3 -0
  34. package/dist/devtools/_nuxt/Cq2IBCZt.js +1 -0
  35. package/dist/devtools/_nuxt/D56-uEuD.js +1 -0
  36. package/dist/devtools/_nuxt/D9eL2h5z.js +1 -0
  37. package/dist/devtools/_nuxt/DC83McAa.js +154 -0
  38. package/dist/devtools/_nuxt/DLfyhkbV.js +1 -0
  39. package/dist/devtools/_nuxt/DRdBN13f.js +1 -0
  40. package/dist/devtools/_nuxt/DevtoolsEmptyState.CPam6VsX.css +1 -0
  41. package/dist/devtools/_nuxt/DevtoolsSection.BeqVO-za.css +1 -0
  42. package/dist/devtools/_nuxt/DuYBAn1h.js +1 -0
  43. package/dist/devtools/_nuxt/Source.ChvNXxeG.css +1 -0
  44. package/dist/devtools/_nuxt/_hKGTbzI.js +1 -0
  45. package/dist/devtools/_nuxt/builds/latest.json +1 -0
  46. package/dist/devtools/_nuxt/builds/meta/8c443858-dba7-4dd0-b65e-6a31b3bbefed.json +1 -0
  47. package/dist/devtools/_nuxt/entry.DuwzcCXL.css +2 -0
  48. package/dist/devtools/_nuxt/error-404.CbnweSUu.css +1 -0
  49. package/dist/devtools/_nuxt/error-500.DrNDBqZi.css +1 -0
  50. package/dist/devtools/_nuxt/jxhrXVY1.js +1 -0
  51. package/dist/devtools/_nuxt/pages.CV7xHNff.css +1 -0
  52. package/dist/devtools/app-sources/index.html +1 -0
  53. package/dist/devtools/debug/index.html +1 -0
  54. package/dist/devtools/docs/index.html +1 -0
  55. package/dist/devtools/index.html +1 -0
  56. package/dist/devtools/user-sources/index.html +1 -0
  57. package/dist/module.d.mts +10 -1
  58. package/dist/module.d.ts +10 -1
  59. package/dist/module.json +1 -1
  60. package/dist/module.mjs +398 -432
  61. package/dist/runtime/server/composables/defineSitemapEventHandler.d.ts +1 -1
  62. package/dist/runtime/server/kit.d.ts +0 -1
  63. package/dist/runtime/server/kit.js +5 -7
  64. package/dist/runtime/server/plugins/warm-up.js +1 -1
  65. package/dist/runtime/server/robots-polyfill/getPathRobotConfig.d.ts +1 -1
  66. package/dist/runtime/server/robots-polyfill/getPathRobotConfig.js +1 -1
  67. package/dist/runtime/server/routes/__sitemap__/debug-production.d.ts +17 -0
  68. package/dist/runtime/server/routes/__sitemap__/debug-production.js +77 -0
  69. package/dist/runtime/server/routes/__sitemap__/debug.d.ts +2 -2
  70. package/dist/runtime/server/routes/__sitemap__/debug.js +23 -4
  71. package/dist/runtime/server/routes/__sitemap__/nuxt-content-urls-v2.js +1 -1
  72. package/dist/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.d.ts +1 -3
  73. package/dist/runtime/server/routes/__sitemap__/nuxt-content-urls-v3.js +24 -12
  74. package/dist/runtime/server/routes/sitemap.xsl.js +349 -153
  75. package/dist/runtime/server/sitemap/builder/sitemap-index.js +8 -7
  76. package/dist/runtime/server/sitemap/builder/sitemap.d.ts +1 -1
  77. package/dist/runtime/server/sitemap/builder/sitemap.js +24 -7
  78. package/dist/runtime/server/sitemap/builder/xml.js +55 -25
  79. package/dist/runtime/server/sitemap/event-handlers.js +15 -6
  80. package/dist/runtime/server/sitemap/nitro.js +17 -8
  81. package/dist/runtime/server/sitemap/urlset/normalise.d.ts +2 -1
  82. package/dist/runtime/server/sitemap/urlset/normalise.js +25 -1
  83. package/dist/runtime/server/sitemap/urlset/sources.js +3 -3
  84. package/dist/runtime/types.d.ts +14 -8
  85. package/dist/runtime/utils-pure.d.ts +3 -4
  86. package/dist/runtime/utils-pure.js +13 -41
  87. package/dist/shared/{sitemap.Bj0OAEtK.mjs → sitemap.B99ug6A9.mjs} +9 -5
  88. package/dist/utils.d.mts +21 -10
  89. package/dist/utils.d.ts +21 -10
  90. package/dist/utils.mjs +62 -8
  91. package/package.json +49 -49
  92. package/dist/client/200.html +0 -1
  93. package/dist/client/404.html +0 -1
  94. package/dist/client/__sitemap__/style.xsl +0 -190
  95. package/dist/client/_nuxt/CVDC-Ayb.js +0 -155
  96. package/dist/client/_nuxt/CVO1_9PV.js +0 -1
  97. package/dist/client/_nuxt/Cp-IABpG.js +0 -1
  98. package/dist/client/_nuxt/D0r3Knsf.js +0 -1
  99. package/dist/client/_nuxt/builds/latest.json +0 -1
  100. package/dist/client/_nuxt/builds/meta/1e2c692d-9f57-4b49-a518-f0dad9ea1e8b.json +0 -1
  101. package/dist/client/_nuxt/byQmnvHb.js +0 -1
  102. package/dist/client/_nuxt/cP7UVfHI.js +0 -1
  103. package/dist/client/_nuxt/entry.Ci1pP-eR.css +0 -1
  104. package/dist/client/_nuxt/error-404.DHoMe5Vi.css +0 -1
  105. package/dist/client/_nuxt/error-500.Da7n0rc6.css +0 -1
  106. package/dist/client/index.html +0 -1
  107. package/dist/client/sitemap.xml +0 -7
  108. package/virtual.d.ts +0 -15
package/dist/utils.mjs CHANGED
@@ -1,12 +1,61 @@
1
- export { p as parseHtmlExtractSitemapMeta } from './shared/sitemap.Bj0OAEtK.mjs';
1
+ export { p as parseHtmlExtractSitemapMeta } from './shared/sitemap.B99ug6A9.mjs';
2
+ import { XMLParser } from 'fast-xml-parser';
2
3
  import 'ufo';
3
4
  import 'ultrahtml';
4
5
 
6
+ const parser = new XMLParser({
7
+ isArray: (tagName) => tagName === "sitemap",
8
+ removeNSPrefix: true,
9
+ trimValues: true
10
+ });
11
+ function isValidUrl(value) {
12
+ return URL.canParse(value);
13
+ }
14
+ function parseSitemapIndex(xml) {
15
+ if (!xml)
16
+ throw new Error("Empty XML input provided");
17
+ const parsed = parser.parse(xml);
18
+ if (parsed?.sitemapindex === void 0)
19
+ throw new Error("XML does not contain a valid sitemapindex element");
20
+ if (!parsed.sitemapindex || !parsed.sitemapindex.sitemap)
21
+ return { entries: [], warnings: [] };
22
+ const sitemaps = Array.isArray(parsed.sitemapindex.sitemap) ? parsed.sitemapindex.sitemap : [parsed.sitemapindex.sitemap];
23
+ const warnings = [];
24
+ const entries = [];
25
+ for (const s of sitemaps) {
26
+ if (typeof s.loc !== "string" || !s.loc.trim().length) {
27
+ warnings.push({
28
+ type: "validation",
29
+ message: "Sitemap entry missing required loc element"
30
+ });
31
+ continue;
32
+ }
33
+ const loc = s.loc.trim();
34
+ if (!isValidUrl(loc)) {
35
+ warnings.push({
36
+ type: "validation",
37
+ message: "Sitemap entry has invalid URL",
38
+ context: { url: loc }
39
+ });
40
+ continue;
41
+ }
42
+ entries.push({
43
+ loc,
44
+ ...s.lastmod && { lastmod: s.lastmod.trim() }
45
+ });
46
+ }
47
+ return { entries, warnings };
48
+ }
49
+ function isSitemapIndex(xml) {
50
+ return xml.includes("<sitemapindex") || xml.includes("sitemapindex>");
51
+ }
52
+
5
53
  function isValidString(value) {
6
54
  return typeof value === "string" && value.trim().length > 0;
7
55
  }
8
56
  function parseNumber(value) {
9
- if (typeof value === "number") return value;
57
+ if (typeof value === "number")
58
+ return value;
10
59
  if (typeof value === "string" && value.trim()) {
11
60
  const num = Number.parseFloat(value.trim());
12
61
  return Number.isNaN(num) ? void 0 : num;
@@ -14,7 +63,8 @@ function parseNumber(value) {
14
63
  return void 0;
15
64
  }
16
65
  function parseInteger(value) {
17
- if (typeof value === "number") return Math.floor(value);
66
+ if (typeof value === "number")
67
+ return Math.floor(value);
18
68
  if (typeof value === "string" && value.trim()) {
19
69
  const num = Number.parseInt(value.trim(), 10);
20
70
  return Number.isNaN(num) ? void 0 : num;
@@ -85,10 +135,14 @@ function extractUrlFromParsedElement(urlElement, warnings) {
85
135
  const videos = Array.isArray(urlElement.video) ? urlElement.video : [urlElement.video];
86
136
  const validVideos = videos.map((video) => {
87
137
  const missingFields = [];
88
- if (!isValidString(video.title)) missingFields.push("title");
89
- if (!isValidString(video.thumbnail_loc)) missingFields.push("thumbnail_loc");
90
- if (!isValidString(video.description)) missingFields.push("description");
91
- if (!isValidString(video.content_loc)) missingFields.push("content_loc");
138
+ if (!isValidString(video.title))
139
+ missingFields.push("title");
140
+ if (!isValidString(video.thumbnail_loc))
141
+ missingFields.push("thumbnail_loc");
142
+ if (!isValidString(video.description))
143
+ missingFields.push("description");
144
+ if (!isValidString(video.content_loc))
145
+ missingFields.push("content_loc");
92
146
  if (missingFields.length > 0) {
93
147
  warnings.push({
94
148
  type: "validation",
@@ -364,4 +418,4 @@ async function parseSitemapXml(xml) {
364
418
  }
365
419
  }
366
420
 
367
- export { parseSitemapXml };
421
+ export { isSitemapIndex, parseSitemapIndex, parseSitemapXml };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxtjs/sitemap",
3
3
  "type": "module",
4
- "version": "7.5.2",
4
+ "version": "8.0.0",
5
5
  "description": "Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -18,9 +18,6 @@
18
18
  "bugs": {
19
19
  "url": "https://github.com/nuxt-modules/sitemap/issues"
20
20
  },
21
- "engines": {
22
- "node": ">=18.0.0"
23
- },
24
21
  "exports": {
25
22
  ".": {
26
23
  "types": "./dist/types.d.mts",
@@ -30,10 +27,6 @@
30
27
  "./utils": "./dist/utils.mjs"
31
28
  },
32
29
  "main": "./dist/module.mjs",
33
- "files": [
34
- "dist",
35
- "virtual.d.ts"
36
- ],
37
30
  "typesVersions": {
38
31
  "*": {
39
32
  ".": [
@@ -47,22 +40,11 @@
47
40
  ]
48
41
  }
49
42
  },
50
- "dependencies": {
51
- "@nuxt/devtools-kit": "^3.1.1",
52
- "@nuxt/kit": "^4.2.2",
53
- "chalk": "^5.6.2",
54
- "defu": "^6.1.4",
55
- "fast-xml-parser": "^5.3.3",
56
- "nuxt-site-config": "^3.2.15",
57
- "ofetch": "^1.5.1",
58
- "pathe": "^2.0.3",
59
- "pkg-types": "^2.3.0",
60
- "radix3": "^1.1.2",
61
- "semver": "^7.7.3",
62
- "sirv": "^3.0.2",
63
- "std-env": "^3.10.0",
64
- "ufo": "^1.6.2",
65
- "ultrahtml": "^1.6.0"
43
+ "files": [
44
+ "dist"
45
+ ],
46
+ "engines": {
47
+ "node": ">=18.0.0"
66
48
  },
67
49
  "peerDependencies": {
68
50
  "zod": ">=3"
@@ -72,41 +54,59 @@
72
54
  "optional": true
73
55
  }
74
56
  },
57
+ "dependencies": {
58
+ "@nuxt/devtools-kit": "4.0.0-alpha.3",
59
+ "@nuxt/kit": "^4.4.2",
60
+ "consola": "^3.4.2",
61
+ "defu": "^6.1.4",
62
+ "fast-xml-parser": "^5.5.9",
63
+ "nuxt-site-config": "^4.0.0",
64
+ "nuxtseo-layer-devtools": "^0.3.0",
65
+ "nuxtseo-shared": "^0.7.0",
66
+ "ofetch": "^1.5.1",
67
+ "pathe": "^2.0.3",
68
+ "pkg-types": "^2.3.0",
69
+ "radix3": "^1.1.2",
70
+ "semver": "^7.7.4",
71
+ "sirv": "^3.0.2",
72
+ "std-env": "^4.0.0",
73
+ "ufo": "^1.6.3",
74
+ "ultrahtml": "^1.6.0"
75
+ },
75
76
  "devDependencies": {
77
+ "@antfu/eslint-config": "^7.7.3",
76
78
  "@arethetypeswrong/cli": "^0.18.2",
77
- "@nuxt/content": "^3.10.0",
78
- "@nuxt/eslint-config": "^1.12.1",
79
+ "@nuxt/content": "^3.12.0",
79
80
  "@nuxt/module-builder": "^1.0.2",
80
- "@nuxt/test-utils": "^3.23.0",
81
- "@nuxt/ui": "^4.3.0",
82
- "@nuxtjs/i18n": "^10.2.1",
83
- "@nuxtjs/robots": "^5.6.7",
81
+ "@nuxt/test-utils": "^4.0.0",
82
+ "@nuxt/ui": "^4.6.0",
83
+ "@nuxtjs/i18n": "^10.2.4",
84
+ "@nuxtjs/robots": "^6.0.0-beta.2",
84
85
  "@vue/test-utils": "^2.4.6",
85
- "better-sqlite3": "^12.5.0",
86
- "bumpp": "^10.3.2",
87
- "eslint": "^9.39.2",
88
- "eslint-plugin-n": "^17.23.1",
86
+ "better-sqlite3": "^12.8.0",
87
+ "bumpp": "^11.0.1",
88
+ "eslint": "^10.1.0",
89
+ "eslint-plugin-harlanzw": "^0.11.0",
89
90
  "execa": "^9.6.1",
90
- "happy-dom": "^20.0.11",
91
- "nuxt": "^4.2.2",
92
- "nuxt-i18n-micro": "^2.16.3",
93
- "typescript": "^5.9.3",
94
- "vitest": "3.2.4",
95
- "vue-tsc": "^3.2.2",
96
- "zod": "^4.3.5",
97
- "@nuxtjs/sitemap": "7.5.2"
91
+ "happy-dom": "^20.8.7",
92
+ "nuxt": "^4.4.2",
93
+ "nuxt-i18n-micro": "^3.13.4",
94
+ "typescript": "^6.0.2",
95
+ "vitest": "^4.1.1",
96
+ "vue-tsc": "^3.2.6",
97
+ "zod": "^4.3.6",
98
+ "@nuxtjs/sitemap": "8.0.0"
98
99
  },
99
100
  "scripts": {
100
101
  "lint": "eslint .",
101
- "lint:type": "tsc --noEmit",
102
102
  "lint:fix": "eslint . --fix",
103
- "client:build": "nuxi generate client",
104
- "client:dev": "nuxi dev client --port 3300",
103
+ "client:build": "nuxt generate devtools",
104
+ "devtools": "nuxt dev devtools --port 3030",
105
105
  "build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && npm run client:build",
106
- "dev": "nuxi dev playground",
107
- "prepare:fixtures": "nuxi prepare test/fixtures/basic && nuxi prepare test/fixtures/i18n && nuxi prepare test/fixtures/i18n-micro",
108
- "dev:build": "nuxi build playground",
109
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
106
+ "dev": "nuxt dev playground",
107
+ "prepare:fixtures": "nuxt prepare test/fixtures/basic && nuxt prepare test/fixtures/i18n && nuxt prepare test/fixtures/i18n-micro",
108
+ "dev:build": "nuxt build playground",
109
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
110
110
  "release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.md\"",
111
111
  "test": "vitest run && pnpm run test:attw",
112
112
  "test:unit": "vitest --project=unit",
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/CVDC-Ayb.js"><script type="module" src="/__sitemap__/devtools/_nuxt/CVDC-Ayb.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__sitemap__/devtools",buildId:"1e2c692d-9f57-4b49-a518-f0dad9ea1e8b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767779882832,false]</script></body></html>
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__sitemap__/devtools/_nuxt/entry.Ci1pP-eR.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__sitemap__/devtools/_nuxt/CVDC-Ayb.js"><script type="module" src="/__sitemap__/devtools/_nuxt/CVDC-Ayb.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT_SITE_CONFIG__={_priority:{name:-10,env:-15},env:"production",name:"@nuxtjs\u002Fsitemap-client"}</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__sitemap__/devtools",buildId:"1e2c692d-9f57-4b49-a518-f0dad9ea1e8b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767779882832,false]</script></body></html>
@@ -1,190 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet version="2.0"
3
- xmlns:html="http://www.w3.org/TR/REC-html40"
4
- xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
5
- xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
6
- xmlns:xhtml="http://www.w3.org/1999/xhtml"
7
- xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
8
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
9
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
10
- <xsl:template match="/">
11
- <html xmlns="http://www.w3.org/1999/xhtml">
12
- <head>
13
- <title>XML Sitemap</title>
14
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
15
- <style type="text/css">
16
- body {
17
- font-family: Inter, Helvetica, Arial, sans-serif;
18
- font-size: 14px;
19
- color: #333;
20
- }
21
-
22
- table {
23
- border: none;
24
- border-collapse: collapse;
25
- }
26
-
27
- .bg-yellow-200 {
28
- background-color: #fef9c3;
29
- }
30
-
31
- .p-5 {
32
- padding: 1.25rem;
33
- }
34
-
35
- .rounded {
36
- border-radius: 4px;
37
- }
38
-
39
- .shadow {
40
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
41
- }
42
-
43
- #sitemap tr:nth-child(odd) td {
44
- background-color: #f8f8f8 !important;
45
- }
46
-
47
- #sitemap tbody tr:hover td {
48
- background-color: #fff;
49
- }
50
-
51
- #sitemap tbody tr:hover td, #sitemap tbody tr:hover td a {
52
- color: #000;
53
- }
54
-
55
- .expl a {
56
- color: #398465;
57
- font-weight: 600;
58
- }
59
-
60
- .expl a:visited {
61
- color: #398465;
62
- }
63
-
64
- a {
65
- color: #000;
66
- text-decoration: none;
67
- }
68
-
69
- a:visited {
70
- color: #777;
71
- }
72
-
73
- a:hover {
74
- text-decoration: underline;
75
- }
76
-
77
- td {
78
- font-size: 12px;
79
- }
80
-
81
- .text-2xl {
82
- font-size: 2rem;
83
- font-weight: 600;
84
- line-height: 1.25;
85
- }
86
-
87
- th {
88
- text-align: left;
89
- padding-right: 30px;
90
- font-size: 12px;
91
- }
92
-
93
- thead th {
94
- border-bottom: 1px solid #000;
95
- }
96
- .fixed { position: fixed; }
97
- .right-2 { right: 2rem; }
98
- .top-2 { top: 2rem; }
99
- .w-30 { width: 30rem; }
100
- p { margin: 0; }
101
- li { padding-bottom: 0.5rem; line-height: 1.5; }
102
- h1 { margin: 0; }
103
- .mb-5 { margin-bottom: 1.25rem; }
104
- .mb-3 { margin-bottom: 0.75rem; }
105
- </style>
106
- </head>
107
- <body>
108
- <div style="grid-template-columns: 1fr 1fr; display: grid; margin: 3rem;">
109
- <div>
110
- <div id="content">
111
- <h1 class="text-2xl mb-3">XML Sitemap</h1>
112
- <h2>@nuxtjs/sitemap-client</h2>
113
-
114
- <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &gt; 0">
115
- <p class="expl" style="margin-bottom: 1rem;">
116
- This XML Sitemap Index file contains
117
- <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/> sitemaps.
118
- </p>
119
- <table id="sitemap" cellpadding="3">
120
- <thead>
121
- <tr>
122
- <th width="75%">Sitemap</th>
123
- <th width="25%">Last Modified</th>
124
- </tr>
125
- </thead>
126
- <tbody>
127
- <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
128
- <xsl:variable name="sitemapURL">
129
- <xsl:value-of select="sitemap:loc"/>
130
- </xsl:variable>
131
- <tr>
132
- <td>
133
- <a href="{$sitemapURL}">
134
- <xsl:value-of select="sitemap:loc"/>
135
- </a>
136
- </td>
137
- <td>
138
- <xsl:value-of
139
- select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"/>
140
- </td>
141
- </tr>
142
- </xsl:for-each>
143
- </tbody>
144
- </table>
145
- </xsl:if>
146
- <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &lt; 1">
147
- <p class="expl" style="margin-bottom: 1rem;">
148
- This XML Sitemap contains
149
- <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs.
150
- </p>
151
- <table id="sitemap" cellpadding="3">
152
- <thead>
153
- <tr>
154
- <th width="50%">URL</th>
155
- <th width="25%">Images</th>
156
- <th width="25%">Last Updated</th>
157
- </tr>
158
- </thead>
159
- <tbody>
160
- <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
161
- <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
162
- <xsl:for-each select="sitemap:urlset/sitemap:url">
163
- <tr>
164
- <td>
165
- <xsl:variable name="itemURL">
166
- <xsl:value-of select="sitemap:loc"/>
167
- </xsl:variable>
168
- <a href="{$itemURL}">
169
- <xsl:value-of select="sitemap:loc"/>
170
- </a>
171
- </td>
172
- <td>
173
- <xsl:value-of select="count(image:image)"/>
174
- </td>
175
- <td>
176
- <xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"/>
177
- </td>
178
- </tr>
179
- </xsl:for-each>
180
- </tbody>
181
- </table>
182
- </xsl:if>
183
- </div>
184
- </div>
185
-
186
- </div>
187
- </body>
188
- </html>
189
- </xsl:template>
190
- </xsl:stylesheet>