Add frontmatter data for exclusing an item from sitemap
This commit is contained in:
parent
eeedd5d657
commit
b2ac457511
@ -1,6 +1,7 @@
|
||||
export default {
|
||||
tags: ["changelogs", "feed items"],
|
||||
permalink: false,
|
||||
excludeFromSitemap: true,
|
||||
eleventyComputed: {
|
||||
title: function(data) {
|
||||
return `Changelog: ${this.formatDate(data.date)}`;
|
||||
|
@ -1,15 +0,0 @@
|
||||
---
|
||||
permalink: "{{ page.filePathStem }}"
|
||||
eleventyExcludeFromCollections: true
|
||||
---
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{%- for item in collections.all %}
|
||||
<url>
|
||||
<loc>{{ sitemeta.siteUrl + item.url }}</loc>
|
||||
<lastmod>{% if item.updated %}{{ item.updated.toISOString() }}{% else %}{{ item.date.toISOString() }}{% endif %}</lastmod>
|
||||
<changefreq>{{ item.data.sitemap.changefreq | default("weekly") }}</changefreq>
|
||||
<priority>{{ item.data.sitemap.priority | default(0.5) }}</priority>
|
||||
</url>
|
||||
{%- endfor %}
|
||||
</urlset>
|
17
src/sitemap.xml.vto
Normal file
17
src/sitemap.xml.vto
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
permalink: "{{ page.filePathStem }}"
|
||||
eleventyExcludeFromCollections: true
|
||||
---
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{{ for item of collections.all }}
|
||||
{{ if !item.data.excludeFromSitemap }}
|
||||
<url>
|
||||
<loc>{{ sitemeta.siteUrl + item.url }}</loc>
|
||||
<lastmod>{{ item.updated ? item.updated.toISOString() : item.date.toISOString() }}</lastmod>
|
||||
<changefreq>{{ item.data.sitemap.changefreq }}</changefreq>
|
||||
<priority>{{ item.data.sitemap.priority }}</priority>
|
||||
</url>
|
||||
{{ /if }}
|
||||
{{ /for }}
|
||||
</urlset>
|
6
src/src.11tydata.js
Normal file
6
src/src.11tydata.js
Normal file
@ -0,0 +1,6 @@
|
||||
export default {
|
||||
sitemap: {
|
||||
changefreq: "weekly",
|
||||
priority: 0.5,
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user