add subpages to sitemap

This commit is contained in:
2020-07-28 01:04:22 +02:00
parent bb3c510e07
commit c5c6549a22

View File

@@ -246,6 +246,12 @@ def siteMap():
for n in filter(lambda x: x["active"], news): for n in filter(lambda x: x["active"], news):
urls += [("/news?uid={}".format(n[UID]), n[PARSED_TIME], PRIORITY_SECONDARY)] urls += [("/news?uid={}".format(n[UID]), n[PARSED_TIME], PRIORITY_SECONDARY)]
# add /content/ to sitemap #
content = filter(lambda x: x.startswith(IDENTIFIER_PREFIX), app.config.keys())
for c in content:
idWithoutPrefix = c.lstrip(IDENTIFIER_PREFIX)
urls += [("/content?id={}".format(idWithoutPrefix), n[PARSED_TIME], PRIORITY_PRIMARY)]
hostname = flask.request.headers.get("X-REAL-HOSTNAME") hostname = flask.request.headers.get("X-REAL-HOSTNAME")
if not hostname: if not hostname:
hostname = "localhost" hostname = "localhost"