Skip to content

Commit a34ee45

Browse files
authored
Merge pull request #46 from retlehs/patch-1
2 parents 26a6e1f + e210663 commit a34ee45

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
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 & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
---
22
permalink: /sitemap.xml
33
eleventyExcludeFromCollections: true
4+
layout: null
5+
templateEngineOverride: njk
46
---
57
<?xml version="1.0" encoding="utf-8"?>
68
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
7-
{%- for page in collections.all -%}
8-
{%- if page.url != '' and page.data.sitemapIgnore != true -%}
9-
<url>
10-
<loc>{{ env.siteUrl }}{{ page.url | url }}</loc>
11-
{%- if page.date -%}<lastmod>{{ page.date }}</lastmod>{%- endif -%}
12-
{%- if page.data.changefreq -%}<changefreq>{{ page.data.changefreq }}</changefreq>{%- endif -%}
13-
{%- if page.data.priority -%}<priority>{{ page.data.priority }}</priority>{%- endif -%}
14-
</url>
15-
{%- endif -%}
16-
{%- 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 -%}
1719
</urlset>

0 commit comments

Comments
 (0)