Introduce SUMMARY_MAX_PARAGRAPHS

Let the users use only the n-first paragraphs of the article as article
summary.

The advantage of this approach is that we avoid the random word count
ellipsis that will cut content in pieces, while not having to copy the
first paragraph of the article into the article's summary metadata.

If both SUMMARY_MAX_PARAGRAPHS and SUMMARY_MAX_LENGTH are set, then
the SUMMARY_MAX_LENGTH option will apply to the number of paragraphs in
SUMMARY_MAX_PARAGRAPHS.
This commit is contained in:
Agathe Porte 2023-11-17 17:19:52 +01:00
commit fd029b2bc9
7 changed files with 83 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 the first N
paragraphs from the post as a summary using the ``SUMMARY_MAX_PARAGRAPHS``
setting. If both options are in use, the specified number of paragraphs will
be used but may be truncated to respect the specified max 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