Customizing the UI
Enabling the XSL stylesheet
Nuxt Sitemap serves plain XML by default. Chrome deprecated XSLT and announced its removal. Chrome's XSLT deprecation notice
If your browser supports XSLT, you can enable the built-in stylesheet.
nuxt.config.ts
export default defineNuxtConfig({
sitemap: {
xsl: true,
}
})Changing the columns
You can change the columns that are displayed in the sitemap by modifying the xslColumns option.
These have no effect on SEO and are purely for developer experience.
Note: You must always have a URL column at the start.
nuxt.config.ts
export default defineNuxtConfig({
sitemap: {
xsl: true,
xslColumns: [
// URL column must always be set, no value needed
{ label: 'URL', width: '75%' },
{ label: 'Last Modified', select: 'sitemap:lastmod', width: '25%' },
],
},
})The select you provide is an XSL expression that will be evaluated against the sitemap entry.
It's recommended to prefix the value with sitemap: if in doubt.
Example: Adding priority and changefreq
nuxt.config.ts
export default defineNuxtConfig({
sitemap: {
xsl: true,
xslColumns: [
{ label: 'URL', width: '50%' },
{ label: 'Last Modified', select: 'sitemap:lastmod', width: '25%' },
{ label: 'Priority', select: 'sitemap:priority', width: '12.5%' },
{ label: 'Change Frequency', select: 'sitemap:changefreq', width: '12.5%' },
],
},
})Example: Adding hreflang
nuxt.config.ts
export default defineNuxtConfig({
sitemap: {
xsl: true,
xslColumns: [
{ label: 'URL', width: '50%' },
{ label: 'Last Modified', select: 'sitemap:lastmod', width: '25%' },
{ label: 'Hreflangs', select: 'count(xhtml:link)', width: '25%' },
],
},
})Disabling tips
The built-in stylesheet displays tips in development.
You can disable these tips by setting the xslTips option to false.
nuxt.config.ts
export default defineNuxtConfig({
sitemap: {
xsl: true,
xslTips: false,
},
})Was this page helpful?