Skip to content

Commit

Permalink
fix(test): sitemap namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Fupete committed Jan 15, 2024
1 parent cdceed4 commit 552adb2
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions src/sitemap.xml.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@ permalink: /public/sitemap.xml
eleventyExcludeFromCollections: true
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{%- for item in collections.all -%}
{%- if not item.data.excludeFromSitemap and item.url -%}
<url>
<loc>{{ item.url | url | absoluteUrl(meta.url) }}</loc>
{% for link in item.url | locale_links %}
<xhtml:link rel="alternate" hreflang="{{link.lang}}" href="https://danieletabellini.com{{link.url}}" />
{% endfor %}
<lastmod>{{ item.date | dateToFormat('yyyy-MM-dd') }}</lastmod>
</url>
{%- endif -%}
{%- endfor -%}
</urlset>
{# <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> #}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"
>

{%- for item in collections.all -%}
{%- if not item.data.excludeFromSitemap and item.url -%}

<url>

<loc>{{ item.url | url | absoluteUrl(meta.url) }}</loc>
{% for link in item.url | locale_links %}

<xhtml:link rel="alternate" hreflang="{{link.lang}}" href="https://danieletabellini.com{{link.url}}" />
{% endfor %}

<lastmod>{{ item.date | dateToFormat('yyyy-MM-dd') }}</lastmod>

</url>

{%- endif -%}
{%- endfor -%}
</urlset>

0 comments on commit 552adb2

Please sign in to comment.