summaryrefslogtreecommitdiff
path: root/pgweb/docs/struct.py
diff options
context:
space:
mode:
authorMagnus Hagander2017-03-23 11:03:18 +0000
committerMagnus Hagander2017-03-23 11:11:22 +0000
commit428f299f48e4daf507cddfeb520e643c907b3227 (patch)
tree34371bbc7889bee2c6f5bac9879fb121b46e13e8 /pgweb/docs/struct.py
parent30134cb164c0c6c0770b63afc35921af86292d08 (diff)
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.
Diffstat (limited to 'pgweb/docs/struct.py')
-rw-r--r--pgweb/docs/struct.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pgweb/docs/struct.py b/pgweb/docs/struct.py
index ce0b137e..d0325604 100644
--- a/pgweb/docs/struct.py
+++ b/pgweb/docs/struct.py
@@ -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)