Compare commits

...

6 commits

Author SHA1 Message Date
goingforbrooke 83136814db
Merge 4f3e58d1c2 into 7f630a4e31 2024-08-17 18:27:06 +02:00
Paweł Romanowski 7f630a4e31
Merge pull request #73 from pawroman/tweak-config-for-new-rss
Tweak default config to follow RSS generation changes after Zola 0.19
2024-08-17 17:49:29 +02:00
Paweł Romanowski 26ab720d51 Tweak default config to reflect changes in RSS generation after Zola 0.19 changes 2024-08-17 17:48:30 +02:00
Paweł Romanowski dbef3fa69a
Merge pull request #71 from heitorPB/feeds
templates/index: fix broken RSS/ATOM feed rel links
2024-08-17 17:34:32 +02:00
Heitor Pascoal de Bittencourt d0bb9da1d1
templates/index: fix broken RSS/ATOM feed rel links
Zola 0.19.0 changed the config options related to RSS/ATOM feed
generation, allowing multiple feeds at once. This patch addresses this
change and adds as many links in the HTML head as there are feeds.

Fix #64
2024-08-12 16:36:10 -03:00
Brooke 4f3e58d1c2
Use resize_image built-in fx to make image URLs 2024-06-05 12:00:08 -07:00
4 changed files with 21 additions and 13 deletions

View file

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

View file

@ -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 = [

View file

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

View file

@ -1,8 +1,10 @@
{% if src %}
{# If the image's URL is internal to the site... #}
{% if src is not starting_with("http") %}
{# ... then prepend the site's base URL to the image's URL. #}
{% set src = config.base_url ~ src %}
{# ... then convert the page's colocated_path attribute to a string so it can be concatenated... #}
{% set colocated_path = page.colocated_path | as_str %}
{# ... and use `resize_image` to get image's URL for colocated blog posts and non-colocated blog posts. #}
{% set image = resize_image(path=colocated_path ~ src, width=5000, height=5000, op="fit") %}
{% 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 %}