Skip to content

Commit

Permalink
feat: add extra.placeholders options
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Jul 21, 2024
1 parent bccb8b0 commit 80a7c3d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ read_time = true
toc = true
csp = true

[extra.placeholders]
tags = false
subtitle = false

[extra.home]
title = "Halve-Z"
subtitle = "Zola theme"
Expand Down
4 changes: 3 additions & 1 deletion templates/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>
{% if config.extra.read_time == true %}
<span class="word-count">{{ page.word_count ~ "w"}}</span>&nbsp;<span class="read-time">{{ page.reading_time ~ "m"}}</span>
{% endif %}
{% if page.extra.subtitle %}<p>{{ page.extra.subtitle | striptags | truncate(length=150) | safe }}</p>{% endif %}
{% if page.extra.subtitle %}<p>{{ page.extra.subtitle | striptags | truncate(length=150) | safe }}</p>{% elif config.extra.placeholders.subtitle %}<p>~</p>{% endif %}
{% if page.taxonomies["tags"] %}
<ul class="tags title-tags"
{%- for tag in page.taxonomies["tags"] %}
Expand All @@ -27,6 +27,8 @@ <h2>
{%- endif -%}
{% endfor %}
></ul>
{% elif config.extra.placeholders.subtitle %}
<p>untagged</p>
{% endif %}
</li>
{% endfor %}
Expand Down
4 changes: 4 additions & 0 deletions theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ read_time = false
toc = true
csp = false

[extra.placeholders]
tags = false
subtitle = false

[extra.home]
title = "Halve-Z"
subtitle = "Zola theme"
Expand Down

0 comments on commit 80a7c3d

Please sign in to comment.