~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to sphinxdoc/sitemap.py

removed unmaintained sphinx-doc; added managemnt command to create sphinx source code documentation with some own css; serve pure html for documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from django.contrib.sitemaps import Sitemap
2
 
from sphinxdoc.models import App
3
 
import datetime
4
 
import os
5
 
 
6
 
try:
7
 
    app = App.objects.get(slug='wl')
8
 
except:
9
 
    pass
10
 
 
11
 
 
12
 
class DocumentationSitemap(Sitemap):
13
 
    """This is just a dummy class to return the link to docs/wl/genindex."""
14
 
 
15
 
    changefreq = 'yearly'
16
 
    priority = 0.5
17
 
 
18
 
    def items(self):
19
 
        return ['']
20
 
 
21
 
    def location(self, item):
22
 
        return '/docs/wl/genindex/'
23
 
 
24
 
    def lastmod(self, item):
25
 
        return datetime.datetime.fromtimestamp(
26
 
            os.path.getmtime(os.path.join(app.path, 'last_build')))