From 9b86ccb80177ddd61cf4b36980dd4ff40814061b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 15 Nov 2023 19:05:39 -0600 Subject: [PATCH] Change: Allow sites to use local Sass files This processes ".scss" files in the "assets/css" directory, allowing downstream sites to use Sass as well as plain CSS. --- doc/content/getstarted.md | 2 +- layouts/partials/css.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/content/getstarted.md b/doc/content/getstarted.md index 31e632ff..fa315114 100644 --- a/doc/content/getstarted.md +++ b/doc/content/getstarted.md @@ -46,7 +46,7 @@ Run `make html`. Output appears in `./public`. Edit `config.yaml` to your liking. -To customize styling, add one or more `*.css` files to the `assets/css` directory. +To customize styling, add one or more `*.css` (or `*.scss` for Sass) files to the `assets/css` directory. These files may make use of Hugo templating, e.g. to access configuration variables as `{{ .Site.Params.somevar }}`. diff --git a/layouts/partials/css.html b/layouts/partials/css.html index 5bc6bf62..0378380e 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -2,7 +2,7 @@ {{- $page := . -}} {{- $inServerMode := .Site.IsServer -}} -{{- $sass := (slice "theme-css/fresh/core.scss") -}} +{{- $sass := (slice "theme-css/fresh/core.scss") | append (resources.Match "css/*.scss") -}} {{- $cssOpts := cond ($inServerMode) (dict "enableSourceMap" true) (dict "outputStyle" "compressed") -}} @@ -15,7 +15,7 @@ - + {{- range $sass -}} {{- if $inServerMode -}}