Compare commits

...

7 commits

Author SHA1 Message Date
Valerio Viperino c2bcfbf614
Merge c84d03c60d into c620187811 2024-06-09 09:26:17 +00:00
Paweł Romanowski c620187811
Merge pull request #60 from heitorPB/trailing-slash
tag page: add / to "all tags" link
2024-06-08 01:12:06 +02:00
Paweł Romanowski 74521c02b5
Merge pull request #61 from rukai/fix_post_view_navigation
Fix postview navigation
2024-06-05 19:53:29 +02:00
Lucas Kent cf114ec7e2 Fix postview navigation 2024-05-04 12:20:58 +10:00
Heitor Pascoal de Bittencourt 4be31aa151
tag page: add / to "all tags" link
This is to improve Google indexing pages, for the /tags/ page. In GitHub
Pages, the URL /tags does not exist per se, but is a redirect to /tags/.
Google Crawler gets confused with 301 HTTP status and does not index it.
2024-03-05 09:29:16 -03:00
Paweł Romanowski 0ced77898f
Merge pull request #59 from heitorPB/async-lazy-images
shortcodes: use async and lazy for images.
2024-02-13 21:11:03 +01:00
Heitor Pascoal de Bittencourt bef4cc9020
shortcodes: use async and lazy for images.
Zola v0.18 added an option to set all images with `decoding=async` and
`load=lazy`, but this only applies to `<img>` tags generated from
Markdown `![]()` syntax. This patch adds these attributes by default to
`figure` and `image` macros.
2024-02-06 15:31:27 -03:00
4 changed files with 29 additions and 27 deletions

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -12,7 +12,7 @@
({{ 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>