Convert root items to Vento

This commit is contained in:
2025-05-03 11:21:24 +08:00
parent 5ca021cf29
commit a1ea172c1f
6 changed files with 22 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
// Installed Plugins
// nstalled Plugins
import { InputPathToUrlTransformPlugin } from "@11ty/eleventy";
import pluginEleventyNavigation from "@11ty/eleventy-navigation";
import pluginSyntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";

View File

@@ -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>

15
src/sitemap.xml.vto Normal file
View File

@@ -0,0 +1,15 @@
---
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 }}
<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>
{{ /for }}
</urlset>

6
src/src.11tydata.js Normal file
View File

@@ -0,0 +1,6 @@
export default {
sitemap: {
changefreq: "weekly",
priority: 0.5,
}
}