mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00

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.
17 lines
437 B
Python
17 lines
437 B
Python
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)
|