mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Remove Content._summary and direclty access metadata on request
This commit is contained in:
parent
b2f0f85802
commit
2acd936bf4
1 changed files with 2 additions and 6 deletions
|
|
@ -149,10 +149,6 @@ class Content(object):
|
|||
self.metadata[key] = value
|
||||
setattr(self, key.lower(), value)
|
||||
|
||||
# store the summary metadata if it is set
|
||||
if 'summary' in self.metadata:
|
||||
self._summary = self.metadata['summary']
|
||||
|
||||
signals.content_object_init.send(self)
|
||||
|
||||
def __str__(self):
|
||||
|
|
@ -346,8 +342,8 @@ class Content(object):
|
|||
This is based on the summary metadata if set, otherwise truncate the
|
||||
content.
|
||||
"""
|
||||
if hasattr(self, '_summary'):
|
||||
return self._summary
|
||||
if 'summary' in self.metadata:
|
||||
return self.metadata['summary']
|
||||
|
||||
if self.settings['SUMMARY_MAX_LENGTH'] is None:
|
||||
return self.content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue