Allow settings to specify a summary length, optionally allowing unlimited summary length

This commit is contained in:
dave mankoff 2012-06-10 17:58:05 -04:00
commit 9fb5969c59
2 changed files with 4 additions and 1 deletions

View file

@ -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"""

View file

@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.',
'ARTICLE_PERMALINK_STRUCTURE': '',
'TYPOGRIFY': False,
'LESS_GENERATOR': False,
'SUMARY_MAX_LENGTH': 50,
}