diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2023-12-24 08:13:33 +0000 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@protonmail.com> | 2023-12-24 08:13:33 +0000 |
| commit | 1c4c99f0c19f19424e3aee04e868c38333164dd9 (patch) | |
| tree | 783970ddbd3d1f696493a8b66d9cff6aed533b68 /src/pages | |
| parent | 3bc3700152504ac0ff4f9a42a45ab59cde2e189d (diff) | |
| download | submelon.dev-1c4c99f0c19f19424e3aee04e868c38333164dd9.tar.gz submelon.dev-1c4c99f0c19f19424e3aee04e868c38333164dd9.tar.bz2 submelon.dev-1c4c99f0c19f19424e3aee04e868c38333164dd9.zip | |
Generate sitemap.xml, robots.txt
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/robots.njk | 7 | ||||
| -rw-r--r-- | src/pages/sitemap.njk | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/pages/robots.njk b/src/pages/robots.njk new file mode 100644 index 0000000..efb8b84 --- /dev/null +++ b/src/pages/robots.njk @@ -0,0 +1,7 @@ +--- +eleventyExcludeFromCollections: true +permalink: /robots.txt +--- +User-agent: * +Allow: / +Sitemap: {{ site.url }}/sitemap.xml
\ No newline at end of file diff --git a/src/pages/sitemap.njk b/src/pages/sitemap.njk new file mode 100644 index 0000000..455c26b --- /dev/null +++ b/src/pages/sitemap.njk @@ -0,0 +1,15 @@ +--- +eleventyExcludeFromCollections: true +permalink: /sitemap.xml +--- +<?xml version="1.0" encoding="UTF-8"?> +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> +{% for item in collections.all %} + <url> + <loc>{{ site.url }}{{ item.url }}</loc> + <lastmod>{{ item.date | formatDate }}</lastmod> + <changefreq>{{ item.data.sitemapChangefreq | default("monthly") }}</changefreq> + <priority>{{ item.data.sitemapPriority | default(0.8) }}</priority> + </url> +{% endfor %} +</urlset>
\ No newline at end of file |
