1
Fork 0

Add short description for meta

This commit is contained in:
Jake Howard 2016-12-20 19:03:58 +00:00
parent 40d597a93f
commit be4137aa7b

View file

@ -29,8 +29,16 @@ class Entity(MetadataPageMixin, Page):
], 'Common page configuration'), ], 'Common page configuration'),
] ]
@property
def short_body(self):
body_words = str(self.body).split(' ')
return ' '.join(body_words[:30]) # limit to 30 words (ish)
def get_meta_image(self): def get_meta_image(self):
return self.image return self.image
def get_meta_description(self):
return self.search_description or self.short_body
class Meta: class Meta:
abstract = True abstract = True