summaryrefslogtreecommitdiff
path: root/pgweb/docs/struct.py
diff options
context:
space:
mode:
authorMagnus Hagander2010-09-28 14:12:13 +0000
committerMagnus Hagander2010-09-28 14:12:13 +0000
commit22f5578c299235a65c561ef2d77231478e9c34a1 (patch)
tree89b12992845586117a3ce9edcab0e68a3d64b94c /pgweb/docs/struct.py
parent8fce64451ecee58d8fdd4450a2b5ff4fedb05dbb (diff)
Add support for generating sitemap.
Each module now contains a struct.py file that will return all the URLs that it can generate (yes, this is a small break of the abstraction of url.py, but we've broken that elsewhere as well), and also which search-engine-weight (0.1-1.0) that this URL should be given.
Diffstat (limited to 'pgweb/docs/struct.py')
-rw-r--r--pgweb/docs/struct.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/pgweb/docs/struct.py b/pgweb/docs/struct.py
new file mode 100644
index 00000000..aaf12b7c
--- /dev/null
+++ b/pgweb/docs/struct.py
@@ -0,0 +1,16 @@
+from datetime import date
+from models import DocPage
+from core.models import Version
+
+def get_struct():
+ now = date.today()
+ currentversion = Version.objects.get(current=True)
+
+ for d in DocPage.objects.all():
+ yield ('docs/%s/static/%s' % (d.version, d.file),
+ None)
+ #FIXME ^ do something smart with priorities on older
+ #versions
+ if d.version == currentversion.tree:
+ yield ('docs/current/static/%s' % d.file,
+ 1.0)