From 9fb5969c59ca47911679b1c8f994ddf613cec522 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Sun, 10 Jun 2012 17:58:05 -0400 Subject: [PATCH] Allow settings to specify a summary length, optionally allowing unlimited summary length --- pelican/contents.py | 4 +++- pelican/settings.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index f5f3a1dc..b8bb0993 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -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""" diff --git a/pelican/settings.py b/pelican/settings.py index 4da66989..a8c8bea4 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'LESS_GENERATOR': False, + 'SUMARY_MAX_LENGTH': 50, }