<?xml version="1.0" encoding="UTF-8"?>
<%- include('../layouts/functions') -%>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <% if (site && Array.isArray(site.pages)) {
    site.pages
      .filter(({ is_draft, status}) => !is_draft && status !== 'draft' && status !== 'hidden')
      .sort(sortByPath)
      .forEach((page) => { -%>
        <url>
          <loc><%= page.path %></loc>
          <lastmod><%= (new Date(page.date_upd || page.date_pub)).toJSON() %></lastmod>
        </url>
      <% });
  } -%>

</urlset>
