summaryrefslogtreecommitdiff
path: root/pgweb/docs/struct.py
diff options
context:
space:
mode:
authorMagnus Hagander2013-08-17 14:16:52 +0000
committerMagnus Hagander2013-08-17 14:16:52 +0000
commit6e378231c1c14c0945ed20ed2f7d3bf62c45c62e (patch)
tree6785c8a7037284252904863d2aec5b0754f45fbc /pgweb/docs/struct.py
parent41210ec9afa539776ccc3dbc0aa45b73e582b40a (diff)
Include development and beta versions in search indexes
This includes both the sitemap used by google and friends and our own site index, which uses the sitemap to decide which URLs to crawl. Fixes #171 Closes #172
Diffstat (limited to 'pgweb/docs/struct.py')
-rw-r--r--pgweb/docs/struct.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pgweb/docs/struct.py b/pgweb/docs/struct.py
index ea64d443..60aa8f68 100644
--- a/pgweb/docs/struct.py
+++ b/pgweb/docs/struct.py
@@ -9,14 +9,14 @@ def get_struct():
# Can't use a model here, because we don't (for some reason) have a
# hard link to the versions table here
curs = connection.cursor()
- curs.execute("SELECT d.version, d.file, v.docsloaded FROM docs d INNER JOIN core_version v ON v.tree=d.version WHERE d.version > 0 AND NOT beta ORDER BY d.version DESC")
+ curs.execute("SELECT d.version, d.file, v.docsloaded, v.beta FROM docs d INNER JOIN core_version v ON v.tree=d.version ORDER BY d.version DESC")
# Start priority is higher than average but lower than what we assign
# to the current version of the docs.
docprio = 0.8
lastversion = None
- for version, filename, loaded in curs.fetchall():
+ for version, filename, loaded, beta in curs.fetchall():
# Decrease the priority with 0.1 for every version of the docs
# we move back in time, until we reach 0.1. At 0.1 it's unlikely
# to show up in a general search, but still possible to reach
@@ -27,7 +27,8 @@ def get_struct():
lastversion = version
yield ('docs/%s/static/%s' % (version, filename),
- docprio, loaded)
+ beta and 0.1 or docprio, # beta versions always get 0.1 in prio
+ loaded)
# Also yield the current version urls, with the highest
# possible priority