From a96ac65ca8e8b5e889a4018a90dfa6d64b34c69d Mon Sep 17 00:00:00 2001 From: Elis Eriksson Date: Sun, 31 May 2026 20:13:47 +0200 Subject: add sitemap, robots.txt and favicon.ico along with other small changes --- _includes/base.njk | 2 +- assets/images/favicon.ico | Bin 0 -> 112884 bytes content/blog/11ty.md | 2 -- content/extras.md | 4 ++-- content/sitemap.njk | 6 ++++++ eleventy.config.mjs | 12 +++++++++--- package.json | 1 + public/robots.txt | 6 ++++++ 8 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 assets/images/favicon.ico create mode 100644 content/sitemap.njk create mode 100644 public/robots.txt diff --git a/_includes/base.njk b/_includes/base.njk index 7c32f5a..6362473 100644 --- a/_includes/base.njk +++ b/_includes/base.njk @@ -18,7 +18,7 @@ {% endif %} {% include "./meta.njk" %} - + diff --git a/assets/images/favicon.ico b/assets/images/favicon.ico new file mode 100644 index 0000000..a9fa659 Binary files /dev/null and b/assets/images/favicon.ico differ diff --git a/content/blog/11ty.md b/content/blog/11ty.md index ed0d20b..b1f5fc6 100644 --- a/content/blog/11ty.md +++ b/content/blog/11ty.md @@ -6,5 +6,3 @@ keywords: new 11ty Thanks to my friend Jan Palma for making the website! (check him out here) The website uses 11ty which is a simple static site generator. - -test diff --git a/content/extras.md b/content/extras.md index 2043a71..caf49c9 100644 --- a/content/extras.md +++ b/content/extras.md @@ -4,6 +4,6 @@ layout: page nav: 19 --- -[CBin](https://paste.spelis.li/) -[CGit](https://git.spelis.li/) +[Paste bin](https://paste.spelis.li/) +[Git repos](https://git.spelis.li/) [File Share](https://share.spelis.li/) diff --git a/content/sitemap.njk b/content/sitemap.njk new file mode 100644 index 0000000..ec892a7 --- /dev/null +++ b/content/sitemap.njk @@ -0,0 +1,6 @@ +--- +permalink: /sitemap.xml +layout: null +eleventyExcludeFromCollections: true +--- +{% sitemap collections.all %} diff --git a/eleventy.config.mjs b/eleventy.config.mjs index 284406a..a1b5ece 100644 --- a/eleventy.config.mjs +++ b/eleventy.config.mjs @@ -7,6 +7,7 @@ import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight"; import fs from "fs" import { OgImage } from 'eleventy-plugin-og-image/og-image'; import path from "path"; +import sitemap from "@quasibit/eleventy-plugin-sitemap"; export class CustomOgImage extends OgImage { async shortcodeOutput() { @@ -14,8 +15,6 @@ export class CustomOgImage extends OgImage { } } - - export default function(eleventyConfig) { // Order matters, put this at the top of your configuration file. eleventyConfig.addFilter("embedSVG", function(filePath) { @@ -67,6 +66,12 @@ export default function(eleventyConfig) { OgImage: CustomOgImage, }); + eleventyConfig.addPlugin(sitemap, { + sitemap: { + hostname: "https://spelis.li", + }, + }); + eleventyConfig.addPlugin(eleventyImageTransformPlugin, { widths: [200, "auto"], htmlOptions: { @@ -111,6 +116,7 @@ export default function(eleventyConfig) { eleventyConfig .addPassthroughCopy({"./public/": "/"}) .addPassthroughCopy({"./assets/": "/assets"}) + .addPassthroughCopy({"./assets/images/favicon.ico": "/favicon.ico"}) }; export const config = { @@ -123,4 +129,4 @@ export const config = { templateFormats: ["md", "njk"], htmlTemplateEngine: "njk", markdownTemplateEngine: "njk" -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index 86c4f4b..154f287 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@11ty/eleventy": "^3.1.2", "@11ty/eleventy-img": "^6.0.4", "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.2", + "@quasibit/eleventy-plugin-sitemap": "^2.2.0", "date-fns": "^4.1.0", "eleventy-plugin-og-image": "^4.2.1", "sass": "^1.97.3" diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..f812c1d --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,6 @@ +# robots.txt :3 + +User-agent: * +Allow: / + +Sitemap: https://spelis.li/sitemap.xml -- cgit v1.3-7-ge9ab