From b3ff6c79a67165e361492948e352667a9a72939a Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 17 Jul 2021 11:48:47 +0800 Subject: [PATCH] Ignore the variables hook in the site file --- _sass/jekyll-theme-chirpy.scss | 1 + {assets/css => _sass}/variables-hook.scss | 2 -- assets/css/style.scss | 16 ++++++---------- 3 files changed, 7 insertions(+), 12 deletions(-) rename {assets/css => _sass}/variables-hook.scss (59%) diff --git a/_sass/jekyll-theme-chirpy.scss b/_sass/jekyll-theme-chirpy.scss index 0f1f97d..c42de00 100644 --- a/_sass/jekyll-theme-chirpy.scss +++ b/_sass/jekyll-theme-chirpy.scss @@ -12,6 +12,7 @@ "addon/module", "addon/variables", + "variables-hook", "addon/syntax", "addon/commons", diff --git a/assets/css/variables-hook.scss b/_sass/variables-hook.scss similarity index 59% rename from assets/css/variables-hook.scss rename to _sass/variables-hook.scss index 22d4ab2..f27e0eb 100644 --- a/assets/css/variables-hook.scss +++ b/_sass/variables-hook.scss @@ -1,5 +1,3 @@ /* Appending custom SCSS variables will override the default ones in `_sass/addon/variables.scsss` */ - -$tab-count: {{ site.tabs | size | plus: 1 }}; // plus 1 for home tab diff --git a/assets/css/style.scss b/assets/css/style.scss index 92cbf59..6ff7046 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -1,16 +1,12 @@ --- --- -{% comment %} include the variables-hook if it exists {% endcomment %} - -{% assign hook = 'variables-hook.scss' %} -{% assign _hook_path = hook | prepend: '/assets/css/' %} -{% assign _hook_obj = site.static_files | where: 'path', _hook_path | first %} - -{% if _hook_obj %} - {% include_relative {{ hook }} %} -{% endif %} +/* + If the number of TAB files has changed, the following variable is required. + And it must be defined before `@import`. +*/ +$tab-count: {{ site.tabs | size | plus: 1 }}; // plus 1 for home tab @import "{{ site.theme }}"; -// append your custom style below +/* append your custom style below */