From 72b878ef81088e365a846d2cd483f0bd3a525077 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Thu, 18 Jul 2024 22:11:18 +0800 Subject: [PATCH] Replace custom CSS and JavaScript frontmatter with bundles --- eleventy.config.js | 3 +++ src/_includes/asummersend/base.njk | 4 +--- src/_includes/cassettebeasts/base.njk | 4 +--- src/_includes/global/baselayout.njk | 11 ++--------- src/_includes/starwarskotor/base.njk | 4 +--- src/pages/guestbook.njk | 6 ++++-- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index d619c185..d87097a9 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -22,7 +22,10 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(eleventyNavigationPlugin); eleventyConfig.addPlugin(metagen); eleventyConfig.addPlugin(emojiReadTime); + + // Eleventy bundle plugin eleventyConfig.addBundle("css"); + eleventyConfig.addBundle("js"); // Add content categories to a collection eleventyConfig.addCollection("categories", function(collectionApi) { diff --git a/src/_includes/asummersend/base.njk b/src/_includes/asummersend/base.njk index 41144419..797b3183 100644 --- a/src/_includes/asummersend/base.njk +++ b/src/_includes/asummersend/base.njk @@ -1,6 +1,4 @@ ---- -customCSSSheets: ["asummersend"] ---- +{%- css %}{% include "src/assets/css/asummersend.css" %}{%- endcss %} {% extends "global/baselayout.njk" %} diff --git a/src/_includes/cassettebeasts/base.njk b/src/_includes/cassettebeasts/base.njk index 92d5f798..fa411f03 100644 --- a/src/_includes/cassettebeasts/base.njk +++ b/src/_includes/cassettebeasts/base.njk @@ -1,6 +1,4 @@ ---- -customCSSSheets: ["cassettebeasts"] ---- +{%- css %}{% include "src/assets/css/cassettebeasts.css" %}{%- endcss %} {% extends "global/baselayout.njk" %} diff --git a/src/_includes/global/baselayout.njk b/src/_includes/global/baselayout.njk index 484168d1..4aa6a79c 100644 --- a/src/_includes/global/baselayout.njk +++ b/src/_includes/global/baselayout.njk @@ -11,11 +11,6 @@ {% include "global/css-bundle.njk" %} {% if hasTooltips %} - {% endif %} - {% if customCSSSheets %} - {%- for sheet in customCSSSheets -%} - - {%- endfor -%} {% endif %} @@ -38,12 +33,10 @@ {% block favicon %}{% include "global/favicon.njk" %}{% endblock %} {# JavaScript #} + {% if toc %} - {% if customJSFiles %} - {%- for jsFile in customJSFiles -%} - - {%- endfor -%} {% endif %} +
Guestbook Archive: 123Guestbook