diff --git a/layouts/partials/css.html b/layouts/partials/css.html index 1ade285..6e671d3 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -1,12 +1,11 @@ -{{ $inServerMode := site.IsServer }} {{ $includePaths := (slice "node_modules") }} {{ $sass := "sass/style.sass" }} {{ $cssOutput := "css/style.css" }} {{ $devOpts := (dict "targetPath" $cssOutput "includePaths" $includePaths "enableSourceMap" true) }} {{ $prodOpts := (dict "targetPath" $cssOutput "includePaths" $includePaths "outputStyle" "compressed") }} -{{ $cssOpts := cond $inServerMode $devOpts $prodOpts }} +{{ $cssOpts := cond hugo.IsProduction $prodOpts $devOpts }} {{ $css := resources.Get $sass | resources.ExecuteAsTemplate $sass . | toCSS $cssOpts }} -{{ if $inServerMode }} +{{ if not hugo.IsProduction }} {{ else }} {{ $prodCss := $css | fingerprint }} diff --git a/package.json b/package.json index b8e2ebe..563ee6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,21 @@ { + "scripts": { + "_build": "npm run _hugo-dev --", + "_hugox": "echo && echo \"FIXME: hugo should be run with --cleanDestinationDir\" && echo && hugo", + "_hugo": "hugo --cleanDestinationDir", + "_hugo-dev": "npm run _hugo -- -e dev -DF", + "_serve": "npm run _hugo-dev -- --minify --disableFastRender serve", + "build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-http://localhost}\"", + "build:production": "npm run _hugo -- --minify", + "build": "npm run _build --", + "clean": "rm -Rf node_modules public/* resources", + "make:public": "make -p public && git init -b main public", + "serve": "npm run _serve --", + "test": "npm run build" + }, "devDependencies": { "bulma": "^0.9.4", "hugo-extended": "^0.111.3" - } + }, + "spelling": "cSpell:ignore bulma -" }