Skip to content

Commit

Permalink
Add option to show only article summary (fixes #13)
Browse files Browse the repository at this point in the history
Set BULRUSH_SHOW_SUMMARY to show a summary, rather than the full article, on
index, category and tag pages.
  • Loading branch information
textbook committed Nov 23, 2020
1 parent 245039f commit 8ecc9c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
7 changes: 6 additions & 1 deletion bulrush/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ <h1 class="title">
</h1>
{% include 'article_infos.html' %}
<div class="section">
{{ article.content }}
{% if BULRUSH_SHOW_SUMMARY %}
{{ article.summary }}
<p><a href="{{ SITEURL }}/{{ article.url }}">Read more...</a></p>
{% else %}
{{ article.content }}
{% endif %}
{% include 'comments.html' %}
</div>
</article>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
test_suite='tests',
tests_require=['pelican'],
url='https://github.com/textbook/bulrush',
version='0.3.2',
version='0.4.0',
)

0 comments on commit 8ecc9c2

Please sign in to comment.