Deprecate the animated_favicon variable

APNG seems to be well supported so it's not needed I guess
This commit is contained in:
daudix
2024-06-21 20:39:43 +03:00
parent b7807bb175
commit fe6de0eb17
21 changed files with 228 additions and 235 deletions

View File

@ -1,32 +1,26 @@
<!-- Taken from the https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/ -->
{#- Taken from the https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/ -#}
{% if page.extra.comments.host %}
{% set host = page.extra.comments.host %}
{% else %}
{% set host = config.extra.comments.host %}
{% endif %}
{%- if page.extra.comments.host -%}
{%- set host = page.extra.comments.host -%}
{%- else -%}
{%- set host = config.extra.comments.host -%}
{%- endif -%}
{% if page.extra.comments.user %}
{% set username = page.extra.comments.user %}
{% else %}
{% set username = config.extra.comments.user %}
{% endif %}
{%- if page.extra.comments.user -%}
{%- set username = page.extra.comments.user -%}
{%- else %}
{%- set username = config.extra.comments.user -%}
{%- endif -%}
{% set id = page.extra.comments.id %}
{% set date_locale = macros_translate::translate(key="date_locale", default="en-IE", language_strings=language_strings) | replace(from="_", to="-") %}
{%- set id = page.extra.comments.id -%}
{%- set date_locale = macros_translate::translate(key="date_locale", default="en-IE", language_strings=language_strings) | replace(from="_", to="-") -%}
<section id="comments">
{% if config.extra.comments.show_qr %}
{%- if config.extra.comments.show_qr -%}
<img id="qrcode" class="no-hover pixels" alt="QR code to a Mastodon post" src="https://api.qrserver.com/v1/create-qr-code/?data=https://{{ host }}/@{{ username }}/{{ id }}&format=gif" />
{% endif %}
<h2>
{{ macros_translate::translate(key="comments", default="Comments", language_strings=language_strings) }}
</h2>
<p>
{{ macros_translate::translate(key="comments_description", default="You can comment on this blog post by publicly replying to this post using a Mastodon or other ActivityPub/Fediverse account. Known non-private replies are displayed below.", language_strings=language_strings) }}
</p>
{%- endif -%}
<h2>{{ macros_translate::translate(key="comments", default="Comments", language_strings=language_strings) }}</h2>
<p>{{ macros_translate::translate(key="comments_description", default="You can comment on this blog post by publicly replying to this post using a Mastodon or other ActivityPub/Fediverse account. Known non-private replies are displayed below.", language_strings=language_strings) }}</p>
<div class="dialog-buttons">
<a id="load-comments" class="inline-button" onclick="loadComments()" onkeypress="loadComments()" tabindex="0">
{{ macros_translate::translate(key="load_comments", default="Load Comments", language_strings=language_strings) }}
@ -35,12 +29,9 @@
{{ macros_translate::translate(key="open_post", default="Open Post", language_strings=language_strings) }}
</a>
</div>
<div id="comments-wrapper">
<noscript>
<p>
{{ macros_translate::translate(key="comments_noscript", default="Loading comments relies on JavaScript. Try enabling JavaScript and reloading, or visit the original post on Mastodon.", language_strings=language_strings) }}
</p>
<p>{{ macros_translate::translate(key="comments_noscript", default="Loading comments relies on JavaScript. Try enabling JavaScript and reloading, or visit the original post on Mastodon.", language_strings=language_strings) }}</p>
</noscript>
</div>
<script type="text/javascript">

View File

@ -1,5 +1,6 @@
{#- Based on https://www.roboleary.net/2022/01/13/copy-code-to-clipboard-blog.html -#}
<script>
// Based on https://www.roboleary.net/2022/01/13/copy-code-to-clipboard-blog.html
document.addEventListener("DOMContentLoaded", function () {
let blocks = document.querySelectorAll("pre[class^='language-']");

View File

@ -1,68 +1,60 @@
<footer id="site-footer">
{% if config.extra.footer.links %}
{%- if config.extra.footer.links -%}
<nav>
<ul>
{% for link in config.extra.footer.links %}
{%- if link.url is matching('https?://') %}
{%- for link in config.extra.footer.links -%}
{%- if link.url is matching('https?://') -%}
<li>
<a href="{{ link.url }}"
{% if current_url | default(value='/') | trim_end_matches(pat='/') | safe == link.url | trim_end_matches(pat='/') | safe %}
class="active"
{% endif %}>
<a href="{{ link.url }}">
{{ macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) }}
</a>
</li>
{%- else %}
{%- else -%}
<li>
<a href="{{ get_url(path=link.url, lang=lang)}}"
{% if current_url | default(value='/') | trim_end_matches(pat='/') | safe == get_url(path=link.url, lang=lang) | trim_end_matches(pat='/') | safe %}
class="active"
{% endif %}>
<a href="{{ get_url(path=link.url, lang=lang)}}">
{{ macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) }}
</a>
</li>
{%- endif %}
{% endfor %}
{%- endif -%}
{%- endfor -%}
</ul>
</nav>
{% endif %}
{%- endif -%}
{% if config.extra.footer.show_copyright %}
<p title="Last built at {{ now() | date(format='%F %a %R') }}">
{% if config.extra.footer.copyright %}
{{ config.extra.footer.copyright }}
{% else %}
&copy; {{ config.title }}, {{ now() | date(format="%Y") }}
{% endif %}
</p>
{% endif %}
{%- if config.extra.footer.show_copyright -%}
{%- if config.extra.footer.copyright -%}
{{ config.extra.footer.copyright | markdown | safe }}
{%- else -%}
<p>&copy; {{ config.title }}, {{ now() | date(format="%Y") }}</p>
{%- endif -%}
{%- endif -%}
{% if config.extra.source_url and config.extra.footer.show_source %}
{%- if config.extra.source_url and config.extra.footer.show_source -%}
<p>
<a href="{{ config.extra.source_url }}">
{{ macros_translate::translate(key="source", default="Website source", language_strings=language_strings) }}
</a>
</p>
{% endif %}
{%- endif -%}
{% if config.extra.footer.show_powered_by %}
{%- if config.extra.footer.show_powered_by -%}
<p>
<small>
{{ macros_translate::translate(key="powered_by", default="Powered by", language_strings=language_strings) }} <a class="link" href="https://www.getzola.org">Zola</a> {{ macros_translate::translate(key="powered_by_and", default="and", language_strings=language_strings) }} <a class="link" href="https://daudix.codeberg.page/duckquill">Duckquill</a>
</small>
</p>
{% endif %}
{%- endif -%}
{% if config.extra.footer.socials %}
{%- if config.extra.footer.socials -%}
<ul id="socials">
{% for link in config.extra.footer.socials %}
{%- for link in config.extra.footer.socials -%}
<li>
<a href="{{ link.url | safe }}" rel="me" title="{{ link.name }}">
<i class="icon" style='mask-image: url("data:image/svg+xml,{{ link.icon }}"); -webkit-mask-image: url("data:image/svg+xml,{{ link.icon }}")'></i>
<span>{{ link.name }}</span>
</a>
</li>
{% endfor %}
{%- endfor -%}
</ul>
{% endif %}
{%- endif -%}
</footer>

View File

@ -8,76 +8,74 @@
<link rel="canonical" href="{{ current_url | default(value='/') | safe }}" />
<title>{% include "partials/title.html" %}</title>
{% if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
{% if config.markdown.highlight_themes_css | length > 0 %}
{%- if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
{%- if config.markdown.highlight_themes_css | length > 0 %}
<link rel="stylesheet" href="{{ get_url(path='syntax-theme-light.css') }}" media="(prefers-color-scheme: light)" />
<link rel="stylesheet" href="{{ get_url(path='syntax-theme-dark.css') }}" media="(prefers-color-scheme: dark)" />
{% else %}
{%- else %}
<link rel="stylesheet" href="{{ get_url(path='syntax-theme.css') }}" />
{% endif %}
{% endif %}
{%- endif %}
{%- endif %}
{% set stylesheets = [ "style.css" ] %}
{%- set stylesheets = [ "style.css" ] %}
{% if config.extra.stylesheets -%}
{% set stylesheets = stylesheets | concat(with=config.extra.stylesheets) %}
{% endif %}
{%- if config.extra.stylesheets %}
{%- set stylesheets = stylesheets | concat(with=config.extra.stylesheets) %}
{%- endif %}
{% if page.extra.stylesheets %}
{% set stylesheets = stylesheets | concat(with=page.extra.stylesheets) %}
{% elif section.extra.stylesheets %}
{% set stylesheets = stylesheets | concat(with=section.extra.stylesheets) %}
{% endif %}
{%- if page.extra.stylesheets -%}
{%- set stylesheets = stylesheets | concat(with=page.extra.stylesheets) %}
{%- elif section.extra.stylesheets %}
{%- set stylesheets = stylesheets | concat(with=section.extra.stylesheets) %}
{%- endif %}
{% for stylesheet in stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=stylesheet) | safe }}" />
{% endfor %}
{%- for stylesheet in stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=stylesheet) | safe }}" />
{%- endfor %}
<style type="text/css">
:root {
--primary-color: {{ config.extra.primary_color }};
--primary-color-alpha: {{ config.extra.primary_color_alpha }};
}
</style>
<style type="text/css">:root {--primary-color: {{ config.extra.primary_color }}; --primary-color-alpha: {{ config.extra.primary_color_alpha }};}</style>
{% if config.extra.goatcounter %}
{%- if config.extra.goatcounter %}
<script data-goatcounter="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count" async src="//gc.zgo.at/count.js"></script>
<noscript>
<img src="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count?p={{ current_path | default(value='/') | safe }}" />
</noscript>
{% endif %}
{%- endif %}
{% if config.extra.show_copy_button %}
{% include "partials/copy-button.html" %}
{% endif %}
{%- if config.extra.show_copy_button %}
{%- set scripts = [ "copy-button.js" ] %}
{%- endif %}
{% if config.extra.scripts %}
{% for script in config.extra.scripts %}
<script src="{{ get_url(path=script) }}"></script>
{% endfor %}
{% endif %}
{%- if config.extra.scripts %}
{%- set scripts = scripts | concat(with=config.extra.scripts) %}
{%- endif %}
{% if config.extra.comments %}
{%- if page.extra.scripts %}
{%- set scripts = scripts | concat(with=page.extra.scripts) %}
{%- elif section.extra.scripts %}
{%- set scripts = scripts | concat(with=section.extra.scripts) %}
{%- endif %}
{%- for script in scripts %}
<script src="{{ get_url(path=script) | safe }}"></script>
{%- endfor %}
{%- if config.extra.comments %}
<link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" />
{% endif %}
{%- endif %}
{% if config.extra.emoji_favicon %}
{%- if config.extra.emoji_favicon %}
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext x='-.07em' y='.89em' font-size='90'%3E{{ config.extra.emoji_favicon }}%3C/text%3E%3C/svg%3E">
{% elif config.extra.animated_favicon %}
<link rel="icon" type="image/gif" href="{{ get_url(path='favicon.gif') }}" />
{% else %}
{%- else %}
<link rel="icon" type="image/png" href="{{ get_url(path='favicon.png') }}" />
{% endif %}
{%- endif %}
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="{{ get_url(path='apple-touch-icon.png') }}" />
{% if config.generate_feed %}
{% block feed -%}
<link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filename) | safe }}" />
{% endblock -%}
{% endif %}
{%- if config.generate_feed %}
<link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filename) | safe }}" />
{%- endif %}
<!-- Open Graph -->
<meta property="og:site_name" content="{{ config.title }}" />
<meta property="og:title" content="{% include 'partials/title.html' %}" />
<meta property="og:url" content="{{ current_url | default(value='/') | safe }}" />

View File

@ -2,9 +2,7 @@
<details>
<summary>
<i class="icon"></i>
<span class="hidden">
{{ macros_translate::translate(key="language", default="Language", language_strings=language_strings) }}
</span>
<span class="hidden">{{ macros_translate::translate(key="language", default="Language", language_strings=language_strings) }}</span>
</summary>
<ul>
{%- for lcode, ldetails in config.languages -%}

View File

@ -1,4 +1,3 @@
{% if config.extra.nav.links %}
<header id="site-nav">
<nav>
<a href="#main" id="main-content" tabindex="0">
@ -7,37 +6,37 @@
<ul>
<li id="home">
<a href="{{ get_url(path="/", lang=lang) }}"
{% if current_url | default(value="/") | trim_end_matches(pat="/") | safe == get_url(path="/", lang=lang) | trim_end_matches(pat='/') | safe %}
{%- if current_url | default(value="/") | trim_end_matches(pat="/") | safe == get_url(path="/", lang=lang) | trim_end_matches(pat='/') | safe -%}
class="active"
{% endif %}>
{%- endif -%}>
{{ config.title }}
</a>
</li>
{% for link in config.extra.nav.links %}
{%- if link.url is matching('https?://') %}
{%- for link in config.extra.nav.links -%}
{%- if link.url is matching('https?://') -%}
<li>
<a href="{{ link.url }}"
{% if current_url | default(value='/') | trim_end_matches(pat='/') | safe == link.url | trim_end_matches(pat='/') | safe %}
{%- if current_url | default(value='/') | trim_end_matches(pat='/') | safe == link.url | trim_end_matches(pat='/') | safe -%}
class="active"
{% endif %}>
{%- endif -%}>
{{ macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) }}
</a>
</li>
{%- else %}
{%- else -%}
<li>
<a href="{{ get_url(path=link.url, lang=lang)}}"
{% if current_url | default(value='/') | trim_end_matches(pat='/') | safe == get_url(path=link.url, lang=lang) | trim_end_matches(pat='/') | safe %}
{%- if current_url | default(value='/') | trim_end_matches(pat='/') | safe == get_url(path=link.url, lang=lang) | trim_end_matches(pat='/') | safe -%}
class="active"
{% endif %}>
{%- endif -%}>
{{ macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) }}
</a>
</li>
{%- endif %}
{% endfor %}
{% if config.languages | length > 0 %}
{% include "partials/language_switcher.html" %}
{% endif %}
{% if config.generate_feed and config.extra.nav.show_feed %}
{%- endif -%}
{%- endfor -%}
{%- if config.languages | length > 0 -%}
{%- include "partials/language_switcher.html" -%}
{%- endif -%}
{%- if config.generate_feed and config.extra.nav.show_feed -%}
<li id="feed">
<a href="{{ get_url(path=config.feed_filename) }}">
<i class="icon"></i>
@ -46,8 +45,7 @@
</span>
</a>
</li>
{% endif %}
{%- endif -%}
</ul>
</nav>
</header>
{% endif %}