Mercurial > public > sg101
diff gpp/news/models.py @ 484:bbbc357ac5f3
For #233; first commit for adding social media sharing buttons to news stories.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 18 Oct 2011 00:04:37 +0000 |
parents | 53fdaf0da539 |
children | 7854d75427af |
line wrap: on
line diff
--- a/gpp/news/models.py Sat Oct 15 22:04:18 2011 +0000 +++ b/gpp/news/models.py Tue Oct 18 00:04:37 2011 +0000 @@ -98,3 +98,16 @@ def search_summary(self): return u"\n".join((self.short_text, self.long_text)) + + def ogp_tags(self): + """ + Returns a dict of Open Graph Protocol meta tags. + + """ + return { + 'og:title': self.title, + 'og:type': 'article', + 'og:url': self.get_absolute_url(), + 'og:image': self.category.icon.url, + 'og:description': self.title, + }