diff options
author | Magnus Hagander | 2016-05-31 13:25:45 +0000 |
---|---|---|
committer | Magnus Hagander | 2016-05-31 13:25:45 +0000 |
commit | 4920f460aab95063cdbf26d96e23a7a24a5e5e36 (patch) | |
tree | e896af0d6186bcd6cdc7f509d7d910fed55cf1e0 /pgweb/docs/struct.py | |
parent | 436dfcd55dafb4ad099ebf082da7f5bf2947201a (diff) |
Don't include /devel/ docs in sitemap
This conflicts with what we had in robots.txt, and generates many
thousands of warnings by Google (and possibly others).
Diffstat (limited to 'pgweb/docs/struct.py')
-rw-r--r-- | pgweb/docs/struct.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pgweb/docs/struct.py b/pgweb/docs/struct.py index a2cc56a3..ce0b137e 100644 --- a/pgweb/docs/struct.py +++ b/pgweb/docs/struct.py @@ -6,8 +6,11 @@ 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 + # Make sure we exclude the /devel/ docs because they are blocked by + # robots.txt, and thus will cause tohusands of warnings in search + # engines. curs = connection.cursor() - curs.execute("SELECT d.version, d.file, v.docsloaded, v.testing FROM docs d INNER JOIN core_version v ON v.tree=d.version ORDER BY d.version DESC") + curs.execute("SELECT d.version, d.file, v.docsloaded, v.testing FROM docs d INNER JOIN core_version v ON v.tree=d.version WHERE version > 0 ORDER BY d.version DESC") # Start priority is higher than average but lower than what we assign # to the current version of the docs. @@ -24,8 +27,7 @@ def get_struct(): docprio -= 0.1 lastversion = version - yield ('docs/%s/static/%s' % (version==0 and 'devel' or version, - filename), + yield ('docs/%s/static/%s' % (version, filename), testing and 0.1 or docprio, # beta/rc versions always get 0.1 in prio loaded) |