Sitemaps for page that should be public viewable
This commit is contained in:
@@ -1,23 +1,16 @@
|
||||
"""To geneate a Sitemap with all events."""
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
from kasu.sitemaps import GenericSitemap
|
||||
from django.utils import timezone
|
||||
from .models import Event
|
||||
|
||||
|
||||
class EventSitemap(Sitemap):
|
||||
"""To add an event to the global sitemap."""
|
||||
class EventSitemap(GenericSitemap):
|
||||
"""sitemap to help indexing all events on this site."""
|
||||
changefreq = "never"
|
||||
protocol = 'https'
|
||||
priority_field = 'start'
|
||||
|
||||
def items(self):
|
||||
"""add all events to the sitemap."""
|
||||
@staticmethod
|
||||
def items():
|
||||
"""add all upcoming and archived events to the sitemap."""
|
||||
return Event.objects.all()
|
||||
|
||||
def priority(self, event):
|
||||
"""give events closer to the present a higer priority for crawlers."""
|
||||
delta = abs((timezone.now() - event.start) / 300.0)
|
||||
return max(1 - delta, 0.1)
|
||||
|
||||
def lastmod(self, event):
|
||||
"""return the last modification date."""
|
||||
return event.date_modified
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "events/event_detail.html" %}
|
||||
{% load i18n thumbnail %}
|
||||
|
||||
{% block title %}{{event.name}}{% endblock %}
|
||||
{% block title %}{% trans "Photos" %}: {{ event.name }}{% endblock %}
|
||||
|
||||
{% block opengraph %}
|
||||
<meta property="og:type" content="album" />
|
||||
|
||||
Reference in New Issue
Block a user