diff --git a/entries/models.py b/entries/models.py index dcdae7f..4bb4454 100644 --- a/entries/models.py +++ b/entries/models.py @@ -40,7 +40,7 @@ class Entry(ModelMeta, models.Model): updated = models.DateTimeField() _metadata = { - 'description': 'excerpt', + 'description': 'excerpt_if_unused', 'image': 'image_url', 'twitter_creator': 'twitter_creator', 'og_profile_id': 'og_profile_id', @@ -55,6 +55,11 @@ class Entry(ModelMeta, models.Model): first_line = self.content.split('\n')[0] return shorten(first_line, width=100, placeholder='…') + @property + def excerpt_if_unused(self): + if self.name: + return self.excerpt + @property def twitter_creator(self): return self.author.twitter_username