Skip to content

Commit

Permalink
adding template for sitemap.xml to unify lastmod
Browse files Browse the repository at this point in the history
  • Loading branch information
livexia committed Jan 25, 2024
1 parent 2e5b9a0 commit 19fc87b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions templates/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see issue: https://github.com/getzola/zola/issues/2335 -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for sitemap_entry in entries %}
<url>
<loc>{{ sitemap_entry.permalink | escape_xml | safe }}</loc>
{%- if sitemap_entry.updated %}
<lastmod>{{ sitemap_entry.updated | date(format="%Y-%m-%dT%T+08:00", timezone="Asia/Shanghai") }}</lastmod>
{%- endif %}
</url> {%- endfor %}
</urlset>

0 comments on commit 19fc87b

Please sign in to comment.