Generate internal sitemap including devel docs

We'll use this to index some things in our own search engine without
exposing it to external sitemap parsers. Not from a security standpoint
of course, but something that will lead to it being possible to search
the devel docs again.
This commit is contained in:
Magnus Hagander
2017-03-23 12:03:18 +01:00
parent 30134cb164
commit 428f299f48
4 changed files with 31 additions and 7 deletions

View File

@ -36,3 +36,15 @@ def get_struct():
if version == currentversion.tree:
yield ('docs/current/static/%s' % filename,
1.0, loaded)
# For our internal sitemap (used only by our own search engine),
# include the devel version of the docs (and only those, since the
# other versions are already included)
def get_internal_struct():
curs = connection.cursor()
curs.execute("SELECT d.file, v.docsloaded FROM docs d INNER JOIN core_version v ON v.tree=d.version WHERE version = 0")
for filename, loaded in curs.fetchall():
yield ('docs/devel/static/%s' % (filename, ),
0.1,
loaded)