Anonymous avatar Anonymous committed 4c7e719

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

Comments (0)

Files changed (2)

cciw/cciwmain/common.py

 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': 

templates/cciw/standard.html

 {% load standardpage %}
 
 {% block extraheader %}
+	<meta name="description" content="{{ meta_description|escape }}" />
+	<meta name="keywords" content="{{ meta_keywords|escape }}" />
 	{{ block.super }}
 	{% block atomfeed %}
 		{% atomfeedlink %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.