From 0107203126e36557e8a85718aa522aa017023d93 Mon Sep 17 00:00:00 2001
From: Helen Chong <119173961+helenclx@users.noreply.github.com>
Date: Tue, 18 Jun 2024 16:33:13 +0800
Subject: [PATCH] Set custom CSS set as frontmatter variable
---
src/_includes/asummersend/base.njk | 8 ++++----
src/_includes/cassettebeasts/base.njk | 8 ++++----
src/_includes/global/baselayout.njk | 6 +++++-
src/_includes/starwarskotor/base.njk | 8 ++++----
4 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/src/_includes/asummersend/base.njk b/src/_includes/asummersend/base.njk
index e6a14b0e..613f05e9 100644
--- a/src/_includes/asummersend/base.njk
+++ b/src/_includes/asummersend/base.njk
@@ -1,3 +1,7 @@
+---
+customCSSSheet: ["asummersend"]
+---
+
{% extends "global/baselayout.njk" %}
{% block metaTitle %}
@@ -8,10 +12,6 @@
{{ title + " | " if title }}A Summer’s End — Hong Kong 1986 Shrine | {{ sitemeta.siteName | safe }}
{% endblock %}
-{% block customCSS %}
-
-{% endblock %}
-
{% block favicon %}
diff --git a/src/_includes/cassettebeasts/base.njk b/src/_includes/cassettebeasts/base.njk
index 8fc67394..b3d52bd1 100644
--- a/src/_includes/cassettebeasts/base.njk
+++ b/src/_includes/cassettebeasts/base.njk
@@ -1,3 +1,7 @@
+---
+customCSSSheet: ["cassettebeasts"]
+---
+
{% extends "global/baselayout.njk" %}
{% block metaTitle %}
@@ -8,10 +12,6 @@
{{ title + " | " if title }}Cassette Beasts Shrine | {{ sitemeta.siteName | safe }}
{% endblock %}
-{% block customCSS %}
-
-{% endblock %}
-
{% block favicon %}
diff --git a/src/_includes/global/baselayout.njk b/src/_includes/global/baselayout.njk
index 0a62b8f7..8ef0dab3 100644
--- a/src/_includes/global/baselayout.njk
+++ b/src/_includes/global/baselayout.njk
@@ -13,7 +13,11 @@
{# CSS #}
{% include "global/css-bundle.njk" %}
- {% block customCSS %}{% endblock %}
+ {% if customCSSSheet %}
+ {%- for sheet in customCSSSheet -%}
+
+ {%- endfor -%}
+ {% endif %}
{# Fonts #}
{% include "global/defaultfont.njk" %}
diff --git a/src/_includes/starwarskotor/base.njk b/src/_includes/starwarskotor/base.njk
index f804760a..3c60565d 100644
--- a/src/_includes/starwarskotor/base.njk
+++ b/src/_includes/starwarskotor/base.njk
@@ -1,3 +1,7 @@
+---
+customCSSSheet: ["starwarskotor"]
+---
+
{% extends "global/baselayout.njk" %}
{% block metaTitle %}
@@ -8,10 +12,6 @@
{{ title + " | " if title }}Star Wars: Knights of the Old Republic Shrine | {{ sitemeta.siteName | safe }}
{% endblock %}
-{% block customCSS %}
-
-{% endblock %}
-
{% block favicon %}