|  | 
|  | 1 | +from dataclasses import dataclass | 
|  | 2 | + | 
|  | 3 | +from django.contrib import sitemaps | 
|  | 4 | +from django_hosts.resolvers import reverse | 
|  | 5 | + | 
|  | 6 | + | 
|  | 7 | +@dataclass | 
|  | 8 | +class URLObject: | 
|  | 9 | +    name: str | 
|  | 10 | +    host: str = "www" | 
|  | 11 | + | 
|  | 12 | + | 
|  | 13 | +class StaticViewSitemap(sitemaps.Sitemap): | 
|  | 14 | +    priority = 0.5 | 
|  | 15 | +    changefreq = "monthly" | 
|  | 16 | + | 
|  | 17 | +    def items(self): | 
|  | 18 | +        return [ | 
|  | 19 | +            # accounts | 
|  | 20 | +            URLObject("registration_register"), | 
|  | 21 | +            # aggregator | 
|  | 22 | +            URLObject("community-index"), | 
|  | 23 | +            URLObject("community-ecosystem"), | 
|  | 24 | +            URLObject("local-django-communities"), | 
|  | 25 | +            # contact | 
|  | 26 | +            URLObject("contact_foundation"), | 
|  | 27 | +            # dashboard | 
|  | 28 | +            URLObject("dashboard-index", host="dashboard"), | 
|  | 29 | +            URLObject("metric-list", host="dashboard"), | 
|  | 30 | +            # djangoproject | 
|  | 31 | +            URLObject("homepage"), | 
|  | 32 | +            URLObject("overview"), | 
|  | 33 | +            URLObject("start"), | 
|  | 34 | +            URLObject("code_of_conduct"), | 
|  | 35 | +            URLObject("conduct_faq"), | 
|  | 36 | +            URLObject("conduct_reporting"), | 
|  | 37 | +            URLObject("conduct_enforcement"), | 
|  | 38 | +            URLObject("conduct_changes"), | 
|  | 39 | +            URLObject("diversity"), | 
|  | 40 | +            URLObject("diversity_changes"), | 
|  | 41 | +            # foundation | 
|  | 42 | +            URLObject("foundation_meeting_archive_index"), | 
|  | 43 | +            # fundraising | 
|  | 44 | +            URLObject("fundraising:index"), | 
|  | 45 | +            # members | 
|  | 46 | +            URLObject("members:individual-members"), | 
|  | 47 | +            URLObject("members:corporate-members"), | 
|  | 48 | +            URLObject("members:corporate-members-join"), | 
|  | 49 | +            URLObject("members:corporate-members-badges"), | 
|  | 50 | +            URLObject("members:teams"), | 
|  | 51 | +            # releases | 
|  | 52 | +            URLObject("download"), | 
|  | 53 | +        ] | 
|  | 54 | + | 
|  | 55 | +    def location(self, item): | 
|  | 56 | +        return reverse(item.name, host=item.host) | 
0 commit comments