mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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'):
|
if hasattr(self, '_summary'):
|
||||||
return self._summary
|
return self._summary
|
||||||
else:
|
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):
|
def _set_summary(self, summary):
|
||||||
"""Dummy function"""
|
"""Dummy function"""
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.',
|
||||||
'ARTICLE_PERMALINK_STRUCTURE': '',
|
'ARTICLE_PERMALINK_STRUCTURE': '',
|
||||||
'TYPOGRIFY': False,
|
'TYPOGRIFY': False,
|
||||||
'LESS_GENERATOR': False,
|
'LESS_GENERATOR': False,
|
||||||
|
'SUMARY_MAX_LENGTH': 50,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue