Skip to content

Commit a1edb6d

Browse files
committed
Change how sitemap.xml works
1 parent f944550 commit a1edb6d

4 files changed

Lines changed: 91 additions & 128 deletions

File tree

eleventy.config.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,31 @@ const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
33
const pluginTOC = require('eleventy-plugin-toc');
44
const markdownIt = require('markdown-it');
55
const markdownItAnchor = require('markdown-it-anchor');
6+
const sitemap = require("@quasibit/eleventy-plugin-sitemap");
67

78
module.exports = function(eleventyConfig) {
89

910
eleventyConfig.addPlugin(syntaxHighlight);
1011

12+
// Add the sitemap plugin with image grabbing enabled
13+
eleventyConfig.addPlugin(sitemap, {
14+
sitemap: {
15+
hostname: "https://aryan-gupta.is-a.dev",
16+
},
17+
images: {
18+
grab: true,
19+
featuredImage: "image"
20+
}
21+
});
22+
1123
eleventyConfig.setLibrary(
1224
'md',
1325
markdownIt({
1426
html: true,
1527
linkify: true,
1628
typographer: true,
1729
}).use(markdownItAnchor, {
18-
slugify: s => s.trim().toLowerCase().replace(/[\s+,.']/g, '-').replace(/[()]/g, ''), // Ensure consistent slugification
30+
slugify: s => s.trim().toLowerCase().replace(/[\s+,.']/g, '-').replace(/[()]/g, ''),
1931
permalink: markdownItAnchor.permalink.ariaHidden({
2032
placement: 'before',
2133
class: 'heading-anchor-link',
@@ -42,10 +54,9 @@ module.exports = function(eleventyConfig) {
4254
eleventyConfig.addPassthroughCopy("src/images");
4355
eleventyConfig.addPassthroughCopy("src/favicon-32x32.png");
4456
eleventyConfig.addPassthroughCopy("robots.txt");
45-
eleventyConfig.addPassthroughCopy("sitemap.xml");
57+
// The sitemap.xml passthrough has been removed
4658

4759
eleventyConfig.addFilter("readableDate", (dateObj, format = "DD") => {
48-
4960
return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat(format);
5061
});
5162

package-lock.json

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"devDependencies": {
33
"@11ty/eleventy": "^3.0.0",
44
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.1",
5+
"@quasibit/eleventy-plugin-sitemap": "^2.2.0",
56
"eleventy-plugin-toc": "^1.1.5",
67
"luxon": "^3.6.1",
78
"markdown-it": "^14.1.0",

sitemap.xml

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)