1. pombredanne
  2. cciw-website2

Commits

luke  committed 4c7e719

[project @ 340]
Added default 'description' and 'keywords' metadata to pages.

  • Participants
  • Parent commits 064a296
  • Branches default

Comments (0)

Files changed (2)

File cciw/cciwmain/common.py

View file
 import datetime
 import urllib
        
-def standard_extra_context(extra_dict=None, title=None):
+def standard_extra_context(title=None, description=None, keywords=None):
     """
     Gets the 'extra_dict' dictionary used for all pages
     """
     Member = cciw.cciwmain.models.Member
-    if extra_dict is None: 
-        extra_dict = {}
         
     if title is None:
         title = "Christian Camps in Wales"
+    if description is None:
+        description = "Details of camps, message boards and photos for the UK charity Christian Camps in Wales"
+    if keywords is None:
+        keywords = "camp, camps, summer camp, Christian, Christian camp, charity"
     
+    extra_dict = {}
     extra_dict['title'] = title
+    extra_dict['meta_description'] = description 
+    extra_dict['meta_keywords'] = keywords
     extra_dict['thisyear'] = get_thisyear()
     extra_dict['misc'] = {
         'logged_in_members': 

File templates/cciw/standard.html

View file
 {% load standardpage %}
 
 {% block extraheader %}
+	<meta name="description" content="{{ meta_description|escape }}" />
+	<meta name="keywords" content="{{ meta_keywords|escape }}" />
 	{{ block.super }}
 	{% block atomfeed %}
 		{% atomfeedlink %}