-
Notifications
You must be signed in to change notification settings - Fork 1
/
context_processors.py
34 lines (26 loc) · 1.1 KB
/
context_processors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from about.models import ContactInfo
from django.contrib.staticfiles.templatetags.staticfiles import static
class ContactInfoDefault(object):
def __init__(self):
""" Hardcoded in case there is no ContactInfo object """
self.webmaster_email_address = "halbesma@mpa-garching.mpg.de"
def set_contactinfo(request):
contactinfo = ContactInfo.objects.first()
if not contactinfo:
contactinfo = ContactInfoDefault()
webmaster_email_address = contactinfo.webmaster_email_address
return {"webmaster_email_address": webmaster_email_address}
def set_meta_tags(request):
page_title = "SupaHarris Catalogue"
page_image = static("img/social_share.png")
page_description = "SupaHarris Catalogue of Globular Clusters in the Milky Way"
page_keywords = (
"Globular Clusters, Star Clusters, Milky Way, Observations, Database, Harris"
)
og_image = page_image
og_title = page_title
twitter_card = ""
twitter_site = "@SupaHarris" # Twitter Handle!
twitter_title = page_title
twitter_description = page_description
twitter_image = page_image