mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
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.
This commit is contained in:
14
pgweb/core/struct.py
Normal file
14
pgweb/core/struct.py
Normal file
@ -0,0 +1,14 @@
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
def get_struct():
|
||||
yield ('', None)
|
||||
yield ('community/', None)
|
||||
|
||||
# Enumerate all the templates that will generate pages
|
||||
for root, dirs, files in os.walk('../templates/pages'):
|
||||
r=root[19:] # Cut out ../templates/pages
|
||||
for f in files:
|
||||
if f.endswith('.html'):
|
||||
yield (os.path.join(r, f),
|
||||
None)
|
Reference in New Issue
Block a user