VermontDepartmentOfHealth / docgov

some public facing standards, guidelines, and, well, documentation
https://docgov.netlify.app/
MIT License
3 stars 3 forks source link

Add sitemap.xml #78

Open KyleMit opened 4 years ago

KyleMit commented 4 years ago

Strategy outlined in How to create sitemap.xml?

Something like this:

---
permalink: /sitemap.xml
sitemapIgnore: true
---
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/assets/styles/sitemap.xsl"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for item in collections.all %}
{%- if item.data.sitemapIgnore !== true %}
  <url>
    <loc>{{ item.url | httpUrl }}</loc>
    {% if item.data.premier.date -%}
    <lastmod>{{ item.data.premier.date | dateDisplay("toISOString") }}</lastmod>
    {%- else -%}
    <lastmod>{{ item.date | dateDisplay("toISOString") }}</lastmod>
    {%- endif %}
    <changefreq>{{ item.data.changefreq | valueIfEmpty("monthly") }}</changefreq>
    <priority>{{ item.data.priority | valueIfEmpty("0.5") }}</priority>
  </url>
{%- endif %}
{%- endfor %}
</urlset>

Oh, heck, and also an RSS feed too:

KyleMit commented 4 years ago

Also add noindex to draft pages from #40 (add draft status)

<meta name="robots" content="noindex">