From 2d2f4abe0108bae156d3a08697ff56cd28e9cdd0 Mon Sep 17 00:00:00 2001 From: Brett Hagman Date: Fri, 10 Apr 2026 16:49:10 -0400 Subject: [PATCH] Fix for outdated/broken sitemap tags - tag is outdated - fixed - tags are not formatted correctly (see https://www.sitemaps.org/protocol.html) - fixed --- pelican/plugins/sitemap/sitemap.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pelican/plugins/sitemap/sitemap.py b/pelican/plugins/sitemap/sitemap.py index 5324279..5320aa8 100644 --- a/pelican/plugins/sitemap/sitemap.py +++ b/pelican/plugins/sitemap/sitemap.py @@ -11,10 +11,7 @@ log = logging.getLogger(__name__) XML_HEADER = """ - + """ TXT_URL = "{0}/{1}\n" @@ -37,13 +34,8 @@ def format_date(date): - """Format the date in the expected format.""" - if date.tzinfo: - tz = date.strftime("%z") - tz = tz[:-2] + ":" + tz[-2:] - else: - tz = "-00:00" - return date.strftime("%Y-%m-%dT%H:%M:%S") + tz + """Format the date in the expected format. See: https://www.sitemaps.org/protocol.html.""" + return date.strftime("%Y-%m-%d") CHANGEFREQ_DEFAULTS = {