Skip to content

Commit

Permalink
Merge branch 'pawroman:master' into feature/show-rss-icon-in-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vvzen authored Aug 18, 2024
2 parents c84d03c + 7f630a4 commit 13fca2f
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 38 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
See the live demo (of the default configuration) here:
https://pawroman.github.io/zola-theme-terminimal/

Tested with Zola v0.17.2. Please note that earlier versions might not work because of breaking changes across Zola versions.
Tested with Zola v0.19.2.

Please note that earlier (and older) versions might not work because of breaking changes across Zola versions.

#### Fork disclaimer

Expand Down
4 changes: 2 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title = "Zola Terminimal theme"
compile_sass = true

# The theme supports feeds (RSS and ATOM)
generate_feed = true
generate_feeds = true

# Use `rss.xml` for RSS feeds and `atom.xml` for ATOM.
feed_filename = "atom.xml"
feed_filenames = ["rss.xml", "atom.xml"]

# Optional: enable tags
taxonomies = [
Expand Down
20 changes: 12 additions & 8 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@

{%- block open_graph %}{{ head_macros::open_graph(config=config) }}{% endblock open_graph -%}

{%- if config.generate_feed %}
{%- if "rss" in config.feed_filename %}
{% set feed_type = 'rss+xml' %}
{%- else %}
{% set feed_type = 'atom+xml' %}
{% endif -%}
<link rel="alternate" type="application/{{ feed_type }}" title="RSS" href="{{ get_url(path=config.feed_filename) | safe }}">
{% endif -%}
{%- if config.generate_feeds %}
{%- for feed in config.feed_filenames %}
{%- if feed is containing('atom') %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}

{%- if feed is containing('rss') %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}

{%- endfor %}
{%- endif -%}

{%- if config.extra.favicon %}
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}">
Expand Down
50 changes: 26 additions & 24 deletions templates/macros/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,33 @@


{% macro earlier_later(page) %}
{%- if config.extra.enable_post_view_navigation and page.lower or page.higher %}
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">{{ config.extra.post_view_navigation_prompt }}</span>
<hr />
{%- if config.extra.enable_post_view_navigation %}
{%- if page.lower or page.higher %}
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">{{ config.extra.post_view_navigation_prompt }}</span>
<hr />
</div>
<div class="pagination__buttons">
{%- if page.higher %}
<span class="button previous">
<a href="{{ page.higher.permalink | safe }}">
<span class="button__icon"></span>&nbsp;
<span class="button__text">{{ page.higher.title }}</span>
</a>
</span>
{% endif %}
{% if page.lower %}
<span class="button next">
<a href="{{ page.lower.permalink | safe }}">
<span class="button__text">{{ page.lower.title }}</span>&nbsp;
<span class="button__icon"></span>
</a>
</span>
{% endif -%}
</div>
</div>
<div class="pagination__buttons">
{%- if page.higher %}
<span class="button previous">
<a href="{{ page.higher.permalink | safe }}">
<span class="button__icon"></span>&nbsp;
<span class="button__text">{{ page.higher.title }}</span>
</a>
</span>
{% endif %}
{% if page.lower %}
<span class="button next">
<a href="{{ page.lower.permalink | safe }}">
<span class="button__text">{{ page.lower.title }}</span>&nbsp;
<span class="button__icon"></span>
</a>
</span>
{% endif -%}
</div>
</div>
{% endif -%}
{% endif -%}
{% endmacro earlier_later %}

Expand Down
2 changes: 1 addition & 1 deletion templates/shortcodes/figure.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if src %}
<figure class="{% if position %}{{ position }}{% else -%} center {%- endif %}" >
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %}{% if style %} style="{{ style }}"{% endif %} />
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %}{% if style %} style="{{ style }}"{% endif %} decoding="async" loading="lazy"/>
{% if caption %}
<figcaption class="{% if caption_position %}{{ caption_position }}{% else -%} center {%- endif %}"{% if caption_style %} style="{{ caption_style | safe }}"{% endif %}>{{ caption | markdown() | safe }}</figcaption>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/shortcodes/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
{# ... then prepend the site's base URL to the image's URL. #}
{% set src = config.base_url ~ src %}
{% endif %}
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %} class="{% if position %}{{ position }}{% else -%} center {%- endif %}" {%- if style %} style="{{ style | safe }}" {%- endif %} />
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %} class="{% if position %}{{ position }}{% else -%} center {%- endif %}" {%- if style %} style="{{ style | safe }}" {%- endif %} decoding="async" loading="lazy"/>
{% endif %}
2 changes: 1 addition & 1 deletion templates/tags/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1 class="post-title">
({{ term.pages | length }} post{{ term.pages | length | pluralize }})
</h1>

<a href="{{ config.base_url | safe }}/tags">
<a href="{{ config.base_url | safe }}/tags/">
Show all tags
</a>

Expand Down

0 comments on commit 13fca2f

Please sign in to comment.