summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkernc <kerncece@gmail.com>2020-08-19 20:25:19 +0200
committerJustin Mayer <entroP@gmail.com>2020-08-20 11:27:49 +0200
commit21c9ce1b73b74aee04d1551edab9d459a26bc1f9 (patch)
tree569bf28b20a975b08d7980f239fe7d4f76d98896
parent01b08bd81207293e13b910969aa10b63fdeaf828 (diff)
downloadpelican-21c9ce1b73b74aee04d1551edab9d459a26bc1f9.tar.gz
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
-rw-r--r--docs/settings.rst4
-rw-r--r--pelican/contents.py2
-rw-r--r--pelican/settings.py2
-rw-r--r--pelican/tests/test_contents.py6
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,