From 19887185c76d100ab837f35d902ae5aef546d871 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Thu, 20 Jun 2019 09:38:21 +0200 Subject: [PATCH] Make use of the fact that Hugo sets enviroment to development when running hugo server. --- README.md | 6 ++---- layouts/partials/styles.html | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6999bdc..aa3264e 100644 --- a/README.md +++ b/README.md @@ -233,11 +233,9 @@ To customise a js or sass file, copy it to the root assets directory and edit it The default styles in "_zen.scss" are boring but functional. You can easily overide them completely by placing an empty file named "_zen.scss" in root assets/sass directory. -By default the sass files are built for production, compressed with fingerprint. By setting the Hugo enviroment variable to "dev" they will instead be nested with sourcemaps. +The sass files are be default built for production, compressed with fingerprint. -``` -ยง hugo serve watch --environment=dev -``` +By setting the Hugo environment variable to "development" (default when running `hugo server`) they will instead be nested with sourcemaps. ## Multilingual diff --git a/layouts/partials/styles.html b/layouts/partials/styles.html index 99b4aca..ee1b186 100644 --- a/layouts/partials/styles.html +++ b/layouts/partials/styles.html @@ -4,7 +4,7 @@ {{ $main_style := resources.Get "sass/styles.scss" | toCSS $main_options | fingerprint -}} {{ $mobile_style := resources.Get "sass/mobile.scss" | toCSS $mobile_options | fingerprint -}} {{ $print_style := resources.Get "sass/print.scss" | toCSS $print_options | fingerprint -}} -{{ if eq hugo.Environment "dev" -}} +{{ if eq hugo.Environment "development" -}} {{ $main_options = (dict "targetPath" "css/styles.css" "outputStyle" "nested" "enableSourceMap" true "includePaths" (slice "assets/lib/typey/stylesheets")) -}} {{ $mobile_options = (dict "targetPath" "css/mobile.css" "outputStyle" "nested" "enableSourceMap" true "includePaths" (slice "assets/lib/typey/stylesheets")) -}} {{ $print_options = (dict "targetPath" "css/print.css" "outputStyle" "nested" "enableSourceMap" true "includePaths" (slice "assets/lib/typey/stylesheets")) -}}