From a9245494c90ae903ca33dc8dfd125d1fb9c8bdbe Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 1 Apr 2020 21:20:35 +0800 Subject: [PATCH] Fixed the template of Sitemap and Feed. --- feed.xml | 4 ++-- sitemap.xml | 18 ++---------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/feed.xml b/feed.xml index 980b9c3..7701795 100644 --- a/feed.xml +++ b/feed.xml @@ -30,8 +30,8 @@ layout: compress {{ post.title }} {{ post.date | date_to_xmlschema }} - {% if post.lastmod %} - {{ post.lastmod | date_to_xmlschema }} + {% if post.seo.date_modified %} + {{ post.seo.date_modified | date_to_xmlschema }} {% else %} {{ site.time | date_to_xmlschema }} {% endif %} diff --git a/sitemap.xml b/sitemap.xml index 2160bba..7b0bb70 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -10,22 +10,11 @@ layout: compress + {% for post in site.posts %} - {% unless post.published == false %} - - {% capture lastmod %} - {% if post.seo.date_modified %} - {{ post.seo.date_modified }} - {% elsif post.date %} - {{ post.date }} - {% else %} - {{ site.time }} - {% endif %} - {% endcapture %} - {{ site.url | append: site.baseurl | append: post.url }} - {{ lastmod | date_to_xmlschema }} + {{ site.time | date_to_xmlschema }} {% if post.sitemap.changefreq %} {{ post.sitemap.changefreq }} @@ -39,9 +28,6 @@ layout: compress 0.5 {% endif %} - - {% endunless %} - {% endfor %} {% for page in site.pages %}