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,7 +33,8 @@
{% macro earlier_later(page) %} {% macro earlier_later(page) %}
{%- if config.extra.enable_post_view_navigation and page.lower or page.higher %} {%- if config.extra.enable_post_view_navigation %}
{%- if page.lower or page.higher %}
<div class="pagination"> <div class="pagination">
<div class="pagination__title"> <div class="pagination__title">
<span class="pagination__title-h">{{ config.extra.post_view_navigation_prompt }}</span> <span class="pagination__title-h">{{ config.extra.post_view_navigation_prompt }}</span>
@ -59,6 +60,7 @@
</div> </div>
</div> </div>
{% endif -%} {% endif -%}
{% endif -%}
{% endmacro earlier_later %} {% endmacro earlier_later %}

View file

@ -1,6 +1,6 @@
{% if src %} {% if src %}
<figure class="{% if position %}{{ position }}{% else -%} center {%- endif %}" > <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 %} {% if caption %}
<figcaption class="{% if caption_position %}{{ caption_position }}{% else -%} center {%- endif %}"{% if caption_style %} style="{{ caption_style | safe }}"{% endif %}>{{ caption | markdown() | safe }}</figcaption> <figcaption class="{% if caption_position %}{{ caption_position }}{% else -%} center {%- endif %}"{% if caption_style %} style="{{ caption_style | safe }}"{% endif %}>{{ caption | markdown() | safe }}</figcaption>
{% endif %} {% endif %}

View file

@ -4,5 +4,5 @@
{# ... then prepend the site's base URL to the image's URL. #} {# ... then prepend the site's base URL to the image's URL. #}
{% set src = config.base_url ~ src %} {% set src = config.base_url ~ src %}
{% endif %} {% 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 %} {% endif %}

View file

@ -12,7 +12,7 @@
({{ term.pages | length }} post{{ term.pages | length | pluralize }}) ({{ term.pages | length }} post{{ term.pages | length | pluralize }})
</h1> </h1>
<a href="{{ config.base_url | safe }}/tags"> <a href="{{ config.base_url | safe }}/tags/">
Show all tags Show all tags
</a> </a>