Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Add OG tags content to ListableMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Minton committed Dec 5, 2016
1 parent 0294ba4 commit bfaff0d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions icekit/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,23 @@ def get_boosted_search_terms(self):
def get_oneliner(self):
return getattr(self, 'oneliner', "")

def get_og_title(self):
"""
return meta_title if exists otherwise fall back to title
"""
if hasattr(self, 'meta_title') and self.meta_title:
return self.meta_title
return self.get_title()

def get_og_image(self):
return self.get_list_image()

def get_og_desciption(self):
if hasattr(self, 'meta_description') and self.meta_description:
return self.meta_description
return self.get_oneliner()



class HeroMixin(models.Model):
"""
Expand Down

0 comments on commit bfaff0d

Please sign in to comment.