Introduce paragraph count summary (#2761)

Co-authored-by: Justin Mayer <entroP@gmail.com>
This commit is contained in:
Agathe 2024-06-25 15:07:41 +02:00 committed by GitHub
commit 513abbfdc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 80 additions and 2 deletions

View file

@ -162,7 +162,10 @@ author you can use ``author`` field.
If you do not explicitly specify summary metadata for a given post, the
``SUMMARY_MAX_LENGTH`` setting can be used to specify how many words from the
beginning of an article are used as the summary.
beginning of an article are used as the summary. You can also use an article's
first N paragraphs as its summary using the ``SUMMARY_MAX_PARAGRAPHS`` setting.
If both settings are in use, the specified number of paragraphs will
be used but may be truncated to respect the specified maximum length.
You can also extract any metadata from the filename through a regular
expression to be set in the ``FILENAME_METADATA`` setting. All named groups

View file

@ -308,6 +308,14 @@ 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_MAX_PARAGRAPHS = None
When creating a short summary of an article, this will be the number of
paragraphs to use as the summary. This only applies if your content
does not otherwise specify a summary. Setting to ``None`` will cause the
summary to use the whole text (up to ``SUMMARY_MAX_LENGTH``) instead of just
the first N paragraphs.
.. data:: SUMMARY_END_SUFFIX = '…'
When creating a short summary of an article and the result was truncated to