forked from github/pelican
Allow settings to specify a summary length, optionally allowing unlimited summary length
This commit is contained in:
parent
ae1424a8dd
commit
9fb5969c59
2 changed files with 4 additions and 1 deletions
|
|
@ -139,7 +139,9 @@ class Page(object):
|
|||
if hasattr(self, '_summary'):
|
||||
return self._summary
|
||||
else:
|
||||
return truncate_html_words(self.content, 50)
|
||||
if self.settings['SUMMARY_MAX_LENGTH']:
|
||||
return truncate_html_words(self.content, self.settings['SUMMARY_MAX_LENGTH'])
|
||||
return self.content
|
||||
|
||||
def _set_summary(self, summary):
|
||||
"""Dummy function"""
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.',
|
|||
'ARTICLE_PERMALINK_STRUCTURE': '',
|
||||
'TYPOGRIFY': False,
|
||||
'LESS_GENERATOR': False,
|
||||
'SUMARY_MAX_LENGTH': 50,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue