From f8b97f76494d7b5c1ff72fb33864bc2a1fd47b87 Mon Sep 17 00:00:00 2001 From: Sebin Nyshkim Date: Tue, 15 Oct 2024 04:18:50 +0200 Subject: [PATCH] refactor: :recycle: use custom sitemap generation instead of package --- eleventy.config.js | 6 ------ src/sitemap.njk | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index 1be27ac..8f9a307 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -11,7 +11,6 @@ import eleventyPluginNavigation from '@11ty/eleventy-navigation'; import eleventyPluginOgImage from 'eleventy-plugin-og-image'; import eleventyPluginReadingTime from '@myxotod/eleventy-plugin-readingtime'; import eleventyPluginRobotsTxt from 'eleventy-plugin-robotstxt'; -import eleventyPluginSitemap from '@quasibit/eleventy-plugin-sitemap'; import eleventyPluginSyntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight'; import markdownItAbbr from 'markdown-it-abbr'; import markdownItCallouts from 'markdown-it-obsidian-callouts'; @@ -59,11 +58,6 @@ export default async function (eleventyConfig) { ] } }); - eleventyConfig.addPlugin(eleventyPluginSitemap, { - sitemap: { - hostname: 'https://blog.sebin-nyshkim.net' - } - }); eleventyConfig.addPlugin(eleventyImageTransformPlugin, { extensions: 'html', formats: ['avif', 'webp', 'auto'], diff --git a/src/sitemap.njk b/src/sitemap.njk index d6e0b5b..073b80f 100644 --- a/src/sitemap.njk +++ b/src/sitemap.njk @@ -1,6 +1,16 @@ --- permalink: /sitemap.xml -layout: null eleventyExcludeFromCollections: true --- -{# {% sitemap collections.all %} #} + + + {% for page in collections.all %} + {% if not page.data.draft %} + + {{ site.url }}{{ page.url | url }} + {{ page.date | isoDate }} + {{ page.data.changeFreq if page.data.changeFreq else "monthly" }} + + {% endif %} + {% endfor %} +