Improve favicon loading logic, add language meta tag

This commit is contained in:
daudix
2024-06-21 21:13:53 +03:00
parent fe6de0eb17
commit 6c092ad49d
2 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@ base_url = "https://daudix.codeberg.page/duckquill"
description = "Modern, pretty, and clean theme." description = "Modern, pretty, and clean theme."
compile_sass = true compile_sass = true
minify_html = false minify_html = true
generate_feed = true generate_feed = true
feed_filename = "atom.xml" feed_filename = "atom.xml"
build_search_index = false build_search_index = false
@ -51,9 +51,9 @@ smart_punctuation = true
primary_color = "#ff7800" primary_color = "#ff7800"
# Same as primary_color, but with 20% opacity # Same as primary_color, but with 20% opacity
primary_color_alpha = "rgba(255, 120, 0, 0.2)" primary_color_alpha = "rgba(255, 120, 0, 0.2)"
# Whether to use emoji as a favicon. # Use emoji as a favicon.
# Replace with an emoji wrapped in quotes. # Only one emoji is being rendered, everyting else is truncated.
emoji_favicon = false # emoji_favicon = "🦆🪶"
# URL to website's issue tracker # URL to website's issue tracker
issues_url = "https://codeberg.org/daudix/duckquill/issues" issues_url = "https://codeberg.org/daudix/duckquill/issues"
# URL to website's source code # URL to website's source code

View File

@ -64,14 +64,13 @@
<link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" /> <link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" />
{%- endif %} {%- endif %}
{%- if config.extra.emoji_favicon %} <link rel="icon" type="image/png" href="{{ get_url(path='favicon.png') }}" />
<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">
{%- else %}
<link rel="icon" type="image/png" href="{{ get_url(path='favicon.png') }}" />
{%- endif %}
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="{{ get_url(path='apple-touch-icon.png') }}" /> <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="{{ get_url(path='apple-touch-icon.png') }}" />
{%- 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 | truncate(length=1, end='') }}%3C/text%3E%3C/svg%3E">
{%- endif %}
{%- if config.generate_feed %} {%- 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 }}" /> <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 %} {%- endif %}
@ -82,4 +81,5 @@
<meta property="og:description" content="{{ page.description | default(value=config.description) }}" /> <meta property="og:description" content="{{ page.description | default(value=config.description) }}" />
<meta property="og:image" content="{{ get_url(path='card.png') }}" /> <meta property="og:image" content="{{ get_url(path='card.png') }}" />
<meta property="twitter:card" content="summary_large_image" /> <meta property="twitter:card" content="summary_large_image" />
<meta property="og:locale" content="{{ macros_translate::translate(key='date_locale', default='en_IE', language_strings=language_strings) }}" />
</head> </head>