Compare commits

..

5 commits

Author SHA1 Message Date
Sandro Stikić ec2fe73ec8
wip 2024-08-24 10:34:08 +08: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
3 changed files with 18 additions and 47 deletions

View file

@ -1,4 +1,3 @@
<!-- omit from toc -->
# Terminimal # Terminimal
[![Build Status](https://github.com/pawroman/zola-theme-terminimal/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/pawroman/zola-theme-terminimal/actions/workflows/pages/pages-build-deployment) [![Build Status](https://github.com/pawroman/zola-theme-terminimal/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/pawroman/zola-theme-terminimal/actions/workflows/pages/pages-build-deployment)
@ -9,9 +8,10 @@
See the live demo (of the default configuration) here: See the live demo (of the default configuration) here:
https://pawroman.github.io/zola-theme-terminimal/ 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.
<!-- omit from toc -->
#### Fork disclaimer #### Fork disclaimer
This theme is a fork (not a port) of "Terminal" Hugo theme This theme is a fork (not a port) of "Terminal" Hugo theme
@ -23,37 +23,6 @@ Many thanks for that outstanding original theme, Radek!
For more information about this fork and the differences to the original theme, please see: For more information about this fork and the differences to the original theme, please see:
[Changes compared to the original theme](#changes-compared-to-the-original-theme) below. [Changes compared to the original theme](#changes-compared-to-the-original-theme) below.
<!-- omit from toc -->
## Table of contents
- [Versioning](#versioning)
- [How to start](#how-to-start)
- [Shortcodes](#shortcodes)
- [`image`](#image)
- [`figure`](#figure)
- [Features](#features)
- [OpenGraph](#opengraph)
- [Mastodon](#mastodon)
- [Configuration](#configuration)
- [Only show the post's description](#only-show-the-posts-description)
- [Colors](#colors)
- [Logo text and link](#logo-text-and-link)
- [Author and copyright](#author-and-copyright)
- [Menu](#menu)
- [Tags](#tags)
- [Pagination](#pagination)
- [Language code](#language-code)
- [Hack font subset](#hack-font-subset)
- [Favicon](#favicon)
- [Page titles](#page-titles)
- [Extending](#extending)
- [How to contribute](#how-to-contribute)
- [Changes compared to the original theme](#changes-compared-to-the-original-theme)
- [New features](#new-features)
- [Features retained from the original](#features-retained-from-the-original)
- [License](#license)
## Versioning ## Versioning
This theme used to be non-versioned, e.g. you'd pull the master branch, and occasionally new features or fixes would This theme used to be non-versioned, e.g. you'd pull the master branch, and occasionally new features or fixes would
@ -161,7 +130,7 @@ the following to your `config.toml`:
```toml ```toml
[extra] [extra]
mastodon_url = "https://hachyderm.io/@opeik" mastodon_url = "https://hachyderm.io/@my_username_here"
``` ```
## Configuration ## Configuration
@ -471,5 +440,3 @@ for more information.
The license for Hack fonts used is included in The license for Hack fonts used is included in
[LICENSE-Hack.md](../master/LICENSE-Hack.md). [LICENSE-Hack.md](../master/LICENSE-Hack.md).
[utterances]: https://utteranc.es/

View file

@ -6,10 +6,10 @@ title = "Zola Terminimal theme"
compile_sass = true compile_sass = true
# The theme supports feeds (RSS and ATOM) # The theme supports feeds (RSS and ATOM)
generate_feed = true generate_feeds = true
# Use `rss.xml` for RSS feeds and `atom.xml` for ATOM. # Use `rss.xml` for RSS feeds and `atom.xml` for ATOM.
feed_filename = "atom.xml" feed_filenames = ["rss.xml", "atom.xml"]
# Optional: enable tags # Optional: enable tags
taxonomies = [ taxonomies = [

View file

@ -13,14 +13,18 @@
{%- block open_graph %}{{ head_macros::open_graph(config=config) }}{% endblock open_graph -%} {%- block open_graph %}{{ head_macros::open_graph(config=config) }}{% endblock open_graph -%}
{%- if config.generate_feed %} {%- if config.generate_feeds %}
{%- if "rss" in config.feed_filename %} {%- for feed in config.feed_filenames %}
{% set feed_type = 'rss+xml' %} {%- if feed is containing('atom') %}
{%- else %} <link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{% set feed_type = 'atom+xml' %} {%- endif %}
{% endif -%}
<link rel="alternate" type="application/{{ feed_type }}" title="RSS" href="{{ get_url(path=config.feed_filename) | safe }}"> {%- if feed is containing('rss') %}
{% endif -%} <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 %} {%- if config.extra.favicon %}
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}"> <link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}">