From 64fcdb51723609550a7e28cb9529f23860ffdb32 Mon Sep 17 00:00:00 2001 From: kernc Date: Wed, 19 Aug 2020 20:25:19 +0200 Subject: [PATCH] =?UTF-8?q?Rename=20setting=20SUMMARY=5FEND=5FMARKER=20?= =?UTF-8?q?=E2=86=92=20SUMMARY=5FEND=5FSUFFIX=20(#2792)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoids clash with 'summary' plugin. Refs: https://github.com/getpelican/pelican-plugins/pull/1284#issuecomment-660715086 --- docs/settings.rst | 4 ++-- pelican/contents.py | 2 +- pelican/settings.py | 2 +- pelican/tests/test_contents.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index e05d7abf..377051b0 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -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 diff --git a/pelican/contents.py b/pelican/contents.py index 2bb2e3a0..6470ee45 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -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): diff --git a/pelican/settings.py b/pelican/settings.py index 11bbafbd..ea3ee8eb 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -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, diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 93f5b212..1a520bc7 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -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,