Set custom CSS set as frontmatter variable

This commit is contained in:
Helen Chong 2024-06-18 16:33:13 +08:00
parent 5952ecf2f2
commit 0107203126
4 changed files with 17 additions and 13 deletions

View File

@ -1,3 +1,7 @@
---
customCSSSheet: ["asummersend"]
---
{% extends "global/baselayout.njk" %} {% extends "global/baselayout.njk" %}
{% block metaTitle %} {% block metaTitle %}
@ -8,10 +12,6 @@
{{ title + " | " if title }}A Summers End — Hong Kong 1986 Shrine | {{ sitemeta.siteName | safe }} {{ title + " | " if title }}A Summers End — Hong Kong 1986 Shrine | {{ sitemeta.siteName | safe }}
{% endblock %} {% endblock %}
{% block customCSS %}
<link rel="stylesheet" href="{{'/assets/css/asummersend.css' | url | safe}}">
{% endblock %}
{% block favicon %} {% block favicon %}
<link rel="apple-touch-icon" sizes="180x180" href="/assets/shrines/asummersend/images/ase-icon.png"> <link rel="apple-touch-icon" sizes="180x180" href="/assets/shrines/asummersend/images/ase-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/shrines/asummersend/images/ase-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/assets/shrines/asummersend/images/ase-icon.png">

View File

@ -1,3 +1,7 @@
---
customCSSSheet: ["cassettebeasts"]
---
{% extends "global/baselayout.njk" %} {% extends "global/baselayout.njk" %}
{% block metaTitle %} {% block metaTitle %}
@ -8,10 +12,6 @@
{{ title + " | " if title }}Cassette Beasts Shrine | {{ sitemeta.siteName | safe }} {{ title + " | " if title }}Cassette Beasts Shrine | {{ sitemeta.siteName | safe }}
{% endblock %} {% endblock %}
{% block customCSS %}
<link rel="stylesheet" href="{{'/assets/css/cassettebeasts.css' | url | safe}}">
{% endblock %}
{% block favicon %} {% block favicon %}
<link rel="apple-touch-icon" sizes="180x180" href="/assets/shrines/cassettebeasts/images/cb-icon.png"> <link rel="apple-touch-icon" sizes="180x180" href="/assets/shrines/cassettebeasts/images/cb-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/shrines/cassettebeasts/images/cb-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/assets/shrines/cassettebeasts/images/cb-icon.png">

View File

@ -13,7 +13,11 @@
{# CSS #} {# CSS #}
{% include "global/css-bundle.njk" %} {% include "global/css-bundle.njk" %}
{% block customCSS %}{% endblock %} {% if customCSSSheet %}
{%- for sheet in customCSSSheet -%}
<link rel="stylesheet" href="{{'/assets/css/' + sheet + '.css' | url | safe}}">
{%- endfor -%}
{% endif %}
{# Fonts #} {# Fonts #}
{% include "global/defaultfont.njk" %} {% include "global/defaultfont.njk" %}

View File

@ -1,3 +1,7 @@
---
customCSSSheet: ["starwarskotor"]
---
{% extends "global/baselayout.njk" %} {% extends "global/baselayout.njk" %}
{% block metaTitle %} {% block metaTitle %}
@ -8,10 +12,6 @@
{{ title + " | " if title }}Star Wars: Knights of the Old Republic Shrine | {{ sitemeta.siteName | safe }} {{ title + " | " if title }}Star Wars: Knights of the Old Republic Shrine | {{ sitemeta.siteName | safe }}
{% endblock %} {% endblock %}
{% block customCSS %}
<link rel="stylesheet" href="{{'/assets/css/starwarskotor.css' | url | safe}}">
{% endblock %}
{% block favicon %} {% block favicon %}
<link rel="apple-touch-icon" sizes="180x180" href="/assets/shrines/starwarskotor/images/kotor-icon.png"> <link rel="apple-touch-icon" sizes="180x180" href="/assets/shrines/starwarskotor/images/kotor-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/shrines/starwarskotor/images/kotor-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/assets/shrines/starwarskotor/images/kotor-icon.png">