Rename setting SUMMARY_END_MARKER → SUMMARY_END_SUFFIX

Avoids clash with 'summary' plugin.
Pelican with previous setting as yet unreleased, so no harm done.

Refs: https://github.com/getpelican/pelican-plugins/pull/1284#issuecomment-660715086
This commit is contained in:
Kernc 2020-08-19 20:07:46 +02:00
commit 8e5e132340
No known key found for this signature in database
GPG key ID: E0955D0CB6D501E3
4 changed files with 6 additions and 6 deletions

View file

@ -303,10 +303,10 @@ Basic settings
does not otherwise specify a summary. Setting to ``None`` will cause the
summary to be a copy of the original content.
.. data:: SUMMARY_END_MARKER = '…'
.. data:: SUMMARY_END_SUFFIX = '…'
When creating a short summary of an article and the result was truncated to
match the required word length, this will be used as the truncation marker.
match the required word length, this will be used as the truncation suffix.
.. data:: WITH_FUTURE_DATES = True

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

@ -111,13 +111,13 @@ class TestPage(TestBase):
self.assertEqual(page.summary, '')
def test_summary_end_marker(self):
# If a :SUMMARY_END_MARKER: is set, and there is no other summary,
# 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,