diff --git a/code/eleventy.config.js b/code/eleventy.config.js index c0584ab..ae9fb63 100644 --- a/code/eleventy.config.js +++ b/code/eleventy.config.js @@ -1,9 +1,10 @@ -const path = require("path"); - module.exports = function (eleventyConfig) { + eleventyConfig.addGlobalData("site", { url: "https://code.moonweb.org" }); + eleventyConfig.addFilter("date", (d) => d.toISOString()); eleventyConfig.addPassthroughCopy({ "shared/theme-code.css": "theme.css" }); eleventyConfig.addPassthroughCopy({ "shared/base.css": "shared-base.css" }); eleventyConfig.addPassthroughCopy({ "shared/favicon/code.svg": "favicon.svg" }); + eleventyConfig.addPassthroughCopy({ "code/robots.txt": "robots.txt" }); return { dir: { diff --git a/code/robots.txt b/code/robots.txt new file mode 100644 index 0000000..f0bdb62 --- /dev/null +++ b/code/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://code.moonweb.org/sitemap.xml diff --git a/code/sitemap.xml.njk b/code/sitemap.xml.njk new file mode 100644 index 0000000..7cbc214 --- /dev/null +++ b/code/sitemap.xml.njk @@ -0,0 +1,5 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- +{% include "sitemap.njk" %} diff --git a/hub/eleventy.config.js b/hub/eleventy.config.js index 42c4656..3246063 100644 --- a/hub/eleventy.config.js +++ b/hub/eleventy.config.js @@ -1,9 +1,10 @@ -const path = require("path"); - module.exports = function (eleventyConfig) { + eleventyConfig.addGlobalData("site", { url: "https://hub.moonweb.org" }); + eleventyConfig.addFilter("date", (d) => d.toISOString()); eleventyConfig.addPassthroughCopy({ "shared/theme-hub.css": "theme.css" }); eleventyConfig.addPassthroughCopy({ "shared/base.css": "shared-base.css" }); eleventyConfig.addPassthroughCopy({ "shared/favicon/hub.svg": "favicon.svg" }); + eleventyConfig.addPassthroughCopy({ "hub/robots.txt": "robots.txt" }); return { dir: { diff --git a/hub/robots.txt b/hub/robots.txt new file mode 100644 index 0000000..778be63 --- /dev/null +++ b/hub/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://hub.moonweb.org/sitemap.xml diff --git a/hub/sitemap.xml.njk b/hub/sitemap.xml.njk new file mode 100644 index 0000000..7cbc214 --- /dev/null +++ b/hub/sitemap.xml.njk @@ -0,0 +1,5 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- +{% include "sitemap.njk" %} diff --git a/infra/eleventy.config.js b/infra/eleventy.config.js index f32b92f..3338af4 100644 --- a/infra/eleventy.config.js +++ b/infra/eleventy.config.js @@ -1,9 +1,10 @@ -const path = require("path"); - module.exports = function (eleventyConfig) { + eleventyConfig.addGlobalData("site", { url: "https://infra.moonweb.org" }); + eleventyConfig.addFilter("date", (d) => d.toISOString()); eleventyConfig.addPassthroughCopy({ "shared/theme-infra.css": "theme.css" }); eleventyConfig.addPassthroughCopy({ "shared/base.css": "shared-base.css" }); eleventyConfig.addPassthroughCopy({ "shared/favicon/infra.svg": "favicon.svg" }); + eleventyConfig.addPassthroughCopy({ "infra/robots.txt": "robots.txt" }); return { dir: { diff --git a/infra/robots.txt b/infra/robots.txt new file mode 100644 index 0000000..b9acb72 --- /dev/null +++ b/infra/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://infra.moonweb.org/sitemap.xml diff --git a/infra/sitemap.xml.njk b/infra/sitemap.xml.njk new file mode 100644 index 0000000..7cbc214 --- /dev/null +++ b/infra/sitemap.xml.njk @@ -0,0 +1,5 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- +{% include "sitemap.njk" %} diff --git a/retro/eleventy.config.js b/retro/eleventy.config.js index d162dfd..729f1d4 100644 --- a/retro/eleventy.config.js +++ b/retro/eleventy.config.js @@ -1,9 +1,10 @@ -const path = require("path"); - module.exports = function (eleventyConfig) { + eleventyConfig.addGlobalData("site", { url: "https://retro.moonweb.org" }); + eleventyConfig.addFilter("date", (d) => d.toISOString()); eleventyConfig.addPassthroughCopy({ "shared/theme-retro.css": "theme.css" }); eleventyConfig.addPassthroughCopy({ "shared/base.css": "shared-base.css" }); eleventyConfig.addPassthroughCopy({ "shared/favicon/retro.svg": "favicon.svg" }); + eleventyConfig.addPassthroughCopy({ "retro/robots.txt": "robots.txt" }); return { dir: { diff --git a/retro/robots.txt b/retro/robots.txt new file mode 100644 index 0000000..b42cb4e --- /dev/null +++ b/retro/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://retro.moonweb.org/sitemap.xml diff --git a/retro/sitemap.xml.njk b/retro/sitemap.xml.njk new file mode 100644 index 0000000..7cbc214 --- /dev/null +++ b/retro/sitemap.xml.njk @@ -0,0 +1,5 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- +{% include "sitemap.njk" %} diff --git a/shared/_includes/base.njk b/shared/_includes/base.njk index 1dde114..37859c9 100644 --- a/shared/_includes/base.njk +++ b/shared/_includes/base.njk @@ -5,6 +5,14 @@ {{ title }} · moonweb.org + + + + + + + + diff --git a/shared/_includes/sitemap.njk b/shared/_includes/sitemap.njk new file mode 100644 index 0000000..e3e10a2 --- /dev/null +++ b/shared/_includes/sitemap.njk @@ -0,0 +1,9 @@ + + +{%- for page in collections.all %} + + {{ site.url }}{{ page.url }} + {{ page.date | date }} + +{%- endfor %} + diff --git a/smarthome/eleventy.config.js b/smarthome/eleventy.config.js index 81f7f12..2f0091a 100644 --- a/smarthome/eleventy.config.js +++ b/smarthome/eleventy.config.js @@ -1,9 +1,10 @@ -const path = require("path"); - module.exports = function (eleventyConfig) { + eleventyConfig.addGlobalData("site", { url: "https://smarthome.moonweb.org" }); + eleventyConfig.addFilter("date", (d) => d.toISOString()); eleventyConfig.addPassthroughCopy({ "shared/theme-smarthome.css": "theme.css" }); eleventyConfig.addPassthroughCopy({ "shared/base.css": "shared-base.css" }); eleventyConfig.addPassthroughCopy({ "shared/favicon/smarthome.svg": "favicon.svg" }); + eleventyConfig.addPassthroughCopy({ "smarthome/robots.txt": "robots.txt" }); return { dir: { diff --git a/smarthome/robots.txt b/smarthome/robots.txt new file mode 100644 index 0000000..b74da2a --- /dev/null +++ b/smarthome/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://smarthome.moonweb.org/sitemap.xml diff --git a/smarthome/sitemap.xml.njk b/smarthome/sitemap.xml.njk new file mode 100644 index 0000000..7cbc214 --- /dev/null +++ b/smarthome/sitemap.xml.njk @@ -0,0 +1,5 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- +{% include "sitemap.njk" %}