feat: introduce skins to customise the theme

Implements #102
This commit is contained in:
welpo 2023-08-10 13:15:34 +02:00
parent d2780f42a3
commit 48d869e03d
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6
45 changed files with 673 additions and 7 deletions

View file

@ -32,6 +32,11 @@
</str:recent_posts>
</str:translations>
{# Load extra CSS (skin) if set in config.toml #}
{%- if config.extra.skin and config.extra.skin != "teal" -%}
<link rel="extra-stylesheet" href="{{ get_url(path='skins/' ~ config.extra.skin ~ '.css', cachebust=true) | safe }}" />
{%- endif -%}
<title>{{ config.title | striptags | safe }}
{%- if term %} - {{ term.name }}
{%- elif section.title %} - {{ section.title }}

View file

@ -30,11 +30,10 @@
<link rel="stylesheet" type="text/css" media="screen" href={{ get_url(path="main.css", cachebust=true ) }} />
{% if config.extra.stylesheets %}
{% for stylesheet in config.extra.stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=stylesheet) }}">
{% endfor %}
{% endif %}
{# Load extra CSS for custom skin #}
{%- if config.extra.skin and config.extra.skin != "teal" -%}
<link rel="stylesheet" href="{{ get_url(path='skins/' ~ config.extra.skin ~ '.css', cachebust=true) | safe }}" />
{%- endif -%}
<meta name="color-scheme" content="{%- if config.extra.theme_switcher -%}light dark{%- elif config.extra.default_theme -%}{{config.extra.default_theme}}{%- else -%}light{%- endif -%}">