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:
21
pgweb/downloads/struct.py
Normal file
21
pgweb/downloads/struct.py
Normal file
@ -0,0 +1,21 @@
|
||||
import os
|
||||
import pickle
|
||||
from datetime import date
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from models import Product
|
||||
|
||||
def get_struct():
|
||||
# Products
|
||||
for p in Product.objects.filter(approved=True):
|
||||
yield ('download/products/%s/' % p.category_id,
|
||||
0.3)
|
||||
|
||||
# FTP browser
|
||||
f = open(settings.FTP_PICKLE, "rb")
|
||||
allnodes = pickle.load(f)
|
||||
f.close()
|
||||
|
||||
for d in allnodes.keys():
|
||||
yield ('ftp/%s' % d, None)
|
Reference in New Issue
Block a user