feat: Emoji favicon support

🦆🪶
This commit is contained in:
daudix
2024-01-20 22:40:48 +03:00
parent e01e715745
commit 5603e05dda
2 changed files with 22 additions and 6 deletions

View File

@ -28,6 +28,8 @@ 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)"
# Emoji favicon; can be set per-page or even section.
emoji_favicon = false
# If the favicon is GIF or not # If the favicon is GIF or not
animated_favicon = false animated_favicon = false
# Tera date format (not used in comments!), # Tera date format (not used in comments!),

View File

@ -1,14 +1,18 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="{{ config.extra.primary_color }}" /> <meta name="theme-color" content="{{ config.extra.primary_color }}" />
<link rel="canonical" href="{{ current_url | default(value='/') }}" /> <link rel="canonical" href="{{ current_url | default(value='/') }}" />
<title> <title>
{% if page.title %} {{ page.title }} - {{ config.title }} {% if page.title %}
{% elif section.title %} {{ section.title }} - {{ config.title }} {{ page.title }} - {{ config.title }}
{% else %} {{ config.title }} {% endif %} {% elif section.title %}
{{ section.title }} - {{ config.title }}
{% else %}
{{ config.title }}
{% endif %}
</title> </title>
<link rel="stylesheet" href="{{ get_url(path='style.css') }}" /> <link rel="stylesheet" href="{{ get_url(path='style.css') }}" />
@ -25,12 +29,22 @@
} }
</style> </style>
{% if config.extra.animated_favicon %} {% if page.extra.emoji_favicon %}
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text x=%22-.1em%22 y=%22.9em%22 font-size=%2290%22>{{ page.extra.emoji_favicon }}</text></svg>">
<link rel="apple-touch-icon" sizes="180x180" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text x=%22-.1em%22 y=%22.9em%22 font-size=%2290%22>{{ page.extra.emoji_favicon }}</text></svg>">
{% elif section.extra.emoji_favicon %}
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text x=%22-.1em%22 y=%22.9em%22 font-size=%2290%22>{{ section.extra.emoji_favicon }}</text></svg>">
<link rel="apple-touch-icon" sizes="180x180" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text x=%22-.1em%22 y=%22.9em%22 font-size=%2290%22>{{ section.extra.emoji_favicon }}</text></svg>">
{% elif config.extra.emoji_favicon %}
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text x=%22-.1em%22 y=%22.9em%22 font-size=%2290%22>{{ config.extra.emoji_favicon }}</text></svg>">
<link rel="apple-touch-icon" sizes="180x180" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text x=%22-.1em%22 y=%22.9em%22 font-size=%2290%22>{{ config.extra.emoji_favicon }}</text></svg>">
{% elif config.extra.animated_favicon %}
<link rel="icon" type="image/gif" href="{{ get_url(path='favicon.gif') }}" /> <link rel="icon" type="image/gif" href="{{ get_url(path='favicon.gif') }}" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ get_url(path='apple-touch-icon.png') }}" />
{% else %} {% else %}
<link rel="icon" type="image/png" href="{{ get_url(path='favicon.png') }}" /> <link rel="icon" type="image/png" href="{{ get_url(path='favicon.png') }}" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ get_url(path='apple-touch-icon.png') }}" />
{% endif %} {% endif %}
<link rel="apple-touch-icon" sizes="180x180" href="{{ get_url(path='apple-touch-icon.png') }}" />
<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 }}" />
<!-- Open Graph --> <!-- Open Graph -->