Rename setting SUMMARY_END_MARKER → SUMMARY_END_SUFFIX (#2792)

Avoids clash with 'summary' plugin.

Refs: https://github.com/getpelican/pelican-plugins/pull/1284#issuecomment-660715086
This commit is contained in:
kernc 2020-08-19 20:25:19 +02:00 committed by GitHub
commit 64fcdb5172
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -392,7 +392,7 @@ class Content:
return truncate_html_words(self.content,
self.settings['SUMMARY_MAX_LENGTH'],
self.settings['SUMMARY_END_MARKER'])
self.settings['SUMMARY_END_SUFFIX'])
@property
def summary(self):

View file

@ -136,7 +136,7 @@ DEFAULT_CONFIG = {
'TYPOGRIFY': False,
'TYPOGRIFY_IGNORE_TAGS': [],
'TYPOGRIFY_DASHES': 'default',
'SUMMARY_END_MARKER': '',
'SUMMARY_END_SUFFIX': '',
'SUMMARY_MAX_LENGTH': 50,
'PLUGIN_PATHS': [],
'PLUGINS': None,

View file

@ -110,14 +110,14 @@ class TestPage(TestBase):
page = Page(**page_kwargs)
self.assertEqual(page.summary, '')
def test_summary_end_marker(self):
# If a :SUMMARY_END_MARKER: is set, and there is no other summary,
def test_summary_end_suffix(self):
# If a :SUMMARY_END_SUFFIX: is set, and there is no other summary,
# generated summary should contain the specified marker at the end.
page_kwargs = self._copy_page_kwargs()
settings = get_settings()
page_kwargs['settings'] = settings
del page_kwargs['metadata']['summary']
settings['SUMMARY_END_MARKER'] = 'test_marker'
settings['SUMMARY_END_SUFFIX'] = 'test_marker'
settings['SUMMARY_MAX_LENGTH'] = 10
page = Page(**page_kwargs)
self.assertEqual(page.summary, truncate_html_words(TEST_CONTENT, 10,