mirror of
https://github.com/pawroman/zola-theme-terminimal.git
synced 2025-01-09 20:21:06 +01:00
Merge pull request #53 from AntoniosBarotsis/show-description
Added the option to only show the description (continuation)
This commit is contained in:
commit
39d13a9a6a
14
README.md
14
README.md
|
@ -121,6 +121,20 @@ default_og_image = "static/ocean.jpg"
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
### Only show the post's description
|
||||||
|
|
||||||
|
On each post you can specify the following:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
description = "test description"
|
||||||
|
|
||||||
|
[extra]
|
||||||
|
show_only_description = true
|
||||||
|
```
|
||||||
|
|
||||||
|
This will render `test description` under this
|
||||||
|
particular post on the homepage instead of a summary.
|
||||||
|
|
||||||
### Colors
|
### Colors
|
||||||
|
|
||||||
Both the accent colors and background colors are
|
Both the accent colors and background colors are
|
||||||
|
|
|
@ -73,7 +73,8 @@
|
||||||
{%- for page in show_pages %}
|
{%- for page in show_pages %}
|
||||||
<div class="post on-list">
|
<div class="post on-list">
|
||||||
{{ post_macros::header(page=page) }}
|
{{ post_macros::header(page=page) }}
|
||||||
{{ post_macros::content(page=page, summary=true) }}
|
|
||||||
|
{{ post_macros::content(page=page, summary=true, show_only_description=page.extra.show_only_description | default(value=false)) }}
|
||||||
</div>
|
</div>
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
{% macro content(page, summary) %}
|
{% macro content(page, summary, show_only_description) %}
|
||||||
{%- if summary and page.summary %}
|
{%- if show_only_description %}
|
||||||
|
<div class="post-content">
|
||||||
|
{{ page.description | safe }}
|
||||||
|
</div>
|
||||||
|
{% elif summary and page.summary %}
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ page.summary | safe }}
|
{{ page.summary | safe }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="post">
|
<div class="post">
|
||||||
{{ post_macros::header(page=page) }}
|
{{ post_macros::header(page=page) }}
|
||||||
{{ post_macros::content(page=page, summary=false) }}
|
{{ post_macros::content(page=page, summary=true, show_only_description=false) }}
|
||||||
{{ post_macros::earlier_later(page=page) }}
|
{{ post_macros::earlier_later(page=page) }}
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
Loading…
Reference in a new issue