From 8ecc9c2e119f42d80df3e13bb40737b0912c1ec1 Mon Sep 17 00:00:00 2001 From: Jonathan Sharpe Date: Mon, 23 Nov 2020 21:44:53 +0000 Subject: [PATCH] Add option to show only article summary (fixes #13) Set BULRUSH_SHOW_SUMMARY to show a summary, rather than the full article, on index, category and tag pages. --- README.md | 3 ++- bulrush/templates/index.html | 7 ++++++- setup.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7a79205..b04f464 100644 --- a/README.md +++ b/README.md @@ -107,9 +107,10 @@ your `pelicanconf.py`: | Setting name | What does it do? | | --- | --- | +| `BULRUSH_SHOW_SUMMARY` | A boolean, whether to show a summary rather than full article on index, category and tag pages. Defaults to `False`. | | `DISQUS_SITENAME` | Enables Disqus comments. Note that you should set up the full Comment Count Link, as no additional text is applied. | | `GITHUB_URL` | Enables the "Fork me on GitHub" ribbon. | -| `GOOGLE_ANALYTICS` | Set to `‘UA-XXXX-YYYY’` to activate Google Analytics. | +| `GOOGLE_ANALYTICS` | Set to `'UA-XXXX-YYYY'` to activate Google Analytics. | | `LICENSE` | A string or dictionary describing the license for the site; see details below. | | `LINKS` | A list of tuples `('Title', 'URL')` for links to appear in the "blogroll" section of the sidebar. | | `MAILCHIMP` | Configure to activate a [MailChimp][20] sign-up form; see details below. | diff --git a/bulrush/templates/index.html b/bulrush/templates/index.html index d79b682..cc85afb 100644 --- a/bulrush/templates/index.html +++ b/bulrush/templates/index.html @@ -10,7 +10,12 @@

{% include 'article_infos.html' %}
- {{ article.content }} + {% if BULRUSH_SHOW_SUMMARY %} + {{ article.summary }} +

Read more...

+ {% else %} + {{ article.content }} + {% endif %} {% include 'comments.html' %}
diff --git a/setup.py b/setup.py index 3bcb226..fb8550f 100644 --- a/setup.py +++ b/setup.py @@ -30,5 +30,5 @@ test_suite='tests', tests_require=['pelican'], url='https://github.com/textbook/bulrush', - version='0.3.2', + version='0.4.0', )