# HG changeset patch # User Brian Neal # Date 1326655657 21600 # Node ID c4696a0cbd3f1c5a6d973a7f10a511ca44a36fd4 # Parent 2c281530dc9c48e9d2f3717030edf02fcca3fe9f Altered the open graph meta tags tag to generate tags for the home page when None is supplied as a parameter. Updated the home page template to use it. diff -r 2c281530dc9c -r c4696a0cbd3f gpp/core/templatetags/core_tags.py --- a/gpp/core/templatetags/core_tags.py Sat Jan 14 14:59:51 2012 -0600 +++ b/gpp/core/templatetags/core_tags.py Sun Jan 15 13:27:37 2012 -0600 @@ -93,14 +93,24 @@ @register.inclusion_tag('core/open_graph_meta_tag.html') -def open_graph_meta_tags(item): +def open_graph_meta_tags(item=None): """ Generates Open Graph meta tags by interrogating the given item. + To generate tags for the home page, set item to None. """ site = Site.objects.get_current() - props = item.ogp_tags() + if item: + props = item.ogp_tags() + else: + props = { + 'og:title': site.name, + 'og:type': 'website', + 'og:url': 'http://%s' % site.domain, + 'og:description': settings.OGP_SITE_DESCRIPTION, + } + props['og:site_name'] = site.name props['fb:admins'] = settings.OGP_FB_ID diff -r 2c281530dc9c -r c4696a0cbd3f gpp/settings/base.py --- a/gpp/settings/base.py Sat Jan 14 14:59:51 2012 -0600 +++ b/gpp/settings/base.py Sun Jan 15 13:27:37 2012 -0600 @@ -294,6 +294,10 @@ ####################################################################### OGP_DEFAULT_IMAGE = 'http://surfguitar101.com/media/podcast/podcast_logo.jpg' OGP_FB_ID = '100001558124013' +OGP_SITE_DESCRIPTION = ('The premier community website for friends and fans of' + ' instrumental surf music. We have forums, podcasts, surf music news, an' + ' event calendar, and much more! The surf is always up at' + ' SurfGuitar101.com!') ####################################################################### # URL's of 3rd party Javascript and CSS files. diff -r 2c281530dc9c -r c4696a0cbd3f gpp/templates/home.html --- a/gpp/templates/home.html Sat Jan 14 14:59:51 2012 -0600 +++ b/gpp/templates/home.html Sun Jan 15 13:27:37 2012 -0600 @@ -1,6 +1,7 @@ {% extends 'base.html' %} {% load url from future %} {% load bulletin_tags %} +{% load core_tags %} {% load news_tags %} {% load weblinks_tags %} {% load downloads_tags %} @@ -9,6 +10,7 @@ {% load script_tags %} {% load cache %} {% block title %}Home{% endblock %} +{% block custom_meta %}{% open_graph_meta_tags %}{% endblock %} {% block custom_head %} {% endblock %}