Skip to content

Commit e210663

Browse files
committed
Fix sitemap wrapped in paragraph tags
1 parent 30d40ce commit e210663

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/config/transforms.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ import beautify from 'js-beautify';
77
export default {
88

99
/**
10-
* Beautify HTML and XML output
10+
* Beautify HTML output
1111
*/
1212
async beautify(eleventyConfig) {
1313
eleventyConfig.addTransform('beautify', async function (content) {
1414
const types = [
1515
'.html',
16-
'.xml',
1716
];
1817

1918
if (this.page.outputPath) {

src/content/xml_sitemap.njk

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
22
permalink: /sitemap.xml
33
eleventyExcludeFromCollections: true
4-
layout: false
4+
layout: null
5+
templateEngineOverride: njk
56
---
67
<?xml version="1.0" encoding="utf-8"?>
78
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
8-
{%- for page in collections.all -%}
9-
{%- if page.url != '' and page.data.sitemapIgnore != true -%}
10-
<url>
11-
<loc>{{ site.url }}{{ page.url | url }}</loc>
12-
{%- if page.date -%}<lastmod>{{ page.date.toISOString() }}</lastmod>{%- endif -%}
13-
{%- if page.data.changefreq -%}<changefreq>{{ page.data.changefreq }}</changefreq>{%- endif -%}
14-
{%- if page.data.priority -%}<priority>{{ page.data.priority }}</priority>{%- endif -%}
15-
</url>
16-
{%- endif -%}
17-
{%- endfor -%}
9+
{%- for page in collections.all -%}
10+
{%- if page.url != '' and page.data.sitemapIgnore != true -%}
11+
<url>
12+
<loc>{{ site.url }}{{ page.url | url }}</loc>
13+
{%- if page.date -%}<lastmod>{{ page.date.toISOString() }}</lastmod>{%- endif -%}
14+
{%- if page.data.changefreq -%}<changefreq>{{ page.data.changefreq }}</changefreq>{%- endif -%}
15+
{%- if page.data.priority -%}<priority>{{ page.data.priority }}</priority>{%- endif -%}
16+
</url>
17+
{%- endif -%}
18+
{%- endfor -%}
1819
</urlset>

0 commit comments

Comments
 (0)