Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions pelican/plugins/sitemap/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
log = logging.getLogger(__name__)

XML_HEADER = """<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
"""

TXT_URL = "{0}/{1}\n"
Expand All @@ -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 = {
Expand Down