comparison MoinMoin/apps/misc/views.py @ 2017:615ca978863f

remove more system items / sysitems_upgrade related code
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 02 Mar 2013 18:15:47 +0100
parents 384555088cab
children 5f2fb2d7ed87
comparison
equal deleted inserted replaced
2016:3e8c910f66f8 2017:615ca978863f
16 from MoinMoin.apps.misc import misc 16 from MoinMoin.apps.misc import misc
17 17
18 from MoinMoin.constants.keys import MTIME 18 from MoinMoin.constants.keys import MTIME
19 from MoinMoin.themes import render_template 19 from MoinMoin.themes import render_template
20 20
21 SITEMAP_HAS_SYSTEM_ITEMS = True
22
23 21
24 @misc.route('/sitemap') 22 @misc.route('/sitemap')
25 def sitemap(): 23 def sitemap():
26 """ 24 """
27 Google (and others) XML sitemap 25 Google (and others) XML sitemap
32 30
33 sitemap = [] 31 sitemap = []
34 for rev in flaskg.storage.documents(wikiname=app.cfg.interwikiname): 32 for rev in flaskg.storage.documents(wikiname=app.cfg.interwikiname):
35 name = rev.name 33 name = rev.name
36 mtime = rev.meta[MTIME] 34 mtime = rev.meta[MTIME]
37 if False: # was: wikiutil.isSystemItem(name) XXX add back later, when we have that in the index 35 # these are the content items:
38 if not SITEMAP_HAS_SYSTEM_ITEMS: 36 changefreq = "daily"
39 continue 37 priority = "0.5"
40 # system items are rather boring
41 changefreq = "yearly"
42 priority = "0.1"
43 else:
44 # these are the content items:
45 changefreq = "daily"
46 priority = "0.5"
47 sitemap.append((name, format_timestamp(mtime), changefreq, priority)) 38 sitemap.append((name, format_timestamp(mtime), changefreq, priority))
48 # add an entry for root url 39 # add an entry for root url
49 root_item = app.cfg.item_root 40 root_item = app.cfg.item_root
50 revs = list(flaskg.storage.documents(wikiname=app.cfg.interwikiname, name=root_item)) 41 revs = list(flaskg.storage.documents(wikiname=app.cfg.interwikiname, name=root_item))
51 if revs: 42 if revs: