plugin request: sitemap.xml (👍10) #4014
Replies: 5 comments
-
|
For starters, this is my current implementation: ---
permalink: /sitemap.xml
excludeFromSitemap: true
---
<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>
{%- for item in collections.all %}
{%- if not item.data.excludeFromSitemap %}
<url>
<loc>https://jaenis.ch{{ item.url }}</loc>
<lastmod>{{ item.date | isoDate }}</lastmod>
<changefreq>{{ item.data.changefreq }}</changefreq>
<priority>{{ item.data.priority }}</priority>
</url>
{%- endif %}
{%- endfor %}
</urlset> seeAlso: 11ty/11ty-website#1853 + https://github.com/11ty/eleventy-base-blog/pull/22/files |
Beta Was this translation helpful? Give feedback.
-
|
And here's mine. Note I've got a filter that removes items without permalinks (which I'm using until there's first class support for drafts). ---
permalink: /sitemap.xml
sitemapIgnore: true
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for item in collections.all | permalinkNotFalse | sort(false, false, 'url') %}
{%- if item.data.sitemapIgnore !== true %}
<url>
<loc>https://www.edwardhorsford.com{{ item.url }}</loc>
<lastmod>{{ item.date | formatDate("dashDate") }}</lastmod>
<changefreq>{{ item.data.changeFrequency or globals.sitemap.defaultChangeFrequency }}</changefreq>
<priority>{{ item.data.sitemapPriority or globals.sitemap.defaultPriority }}</priority>
</url>
{% endif %}
{% endfor %}
</urlset> |
Beta Was this translation helpful? Give feedback.
-
|
Okay, so how could a plugin look like? Am I missing something? |
Beta Was this translation helpful? Give feedback.
-
|
Any thoughts on something that would (also?) work with .11ty.js templating and/or universal filters? Since eleventy-rss-helper seems to be how one would do an RSS feed using .11ty.js, sitemaps may be the last frontier for going all-.11ty.js. 😄 |
Beta Was this translation helpful? Give feedback.
-
|
I have a basic implementation of a sitemap file using Find it at my WIP boilerplate: Eleventy-Core: Sitemap Implementation It relies on computed data quite a bit, and it's not fully fleshed out, but it's a start. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Related #394, #417
See https://github.com/jekyll/jekyll-sitemap
Beta Was this translation helpful? Give feedback.
All reactions