diff options
Diffstat (limited to 'layouts/partials/htmlhead.html')
-rw-r--r-- | layouts/partials/htmlhead.html | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/layouts/partials/htmlhead.html b/layouts/partials/htmlhead.html index 35ea1a8..16fd6d8 100644 --- a/layouts/partials/htmlhead.html +++ b/layouts/partials/htmlhead.html @@ -9,9 +9,17 @@ <title>{{ if eq (.Site.Title) (.Title) }}{{ .Site.Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }}</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> - <link rel="stylesheet" href='{{ "assets/css/main.css" | relURL }}' /> + <!-- CSS --> + {{ if .Site.IsServer }} + {{ $style := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "main.scss" . | toCSS (dict "targetPath" "assets/css/main.css" "enableSourceMap" true) }} + <link rel="stylesheet" href="{{ ($style).RelPermalink }}"> + {{ else }} + {{ $style := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "main.scss" . | toCSS (dict "targetPath" "assets/css/main.css" "enableSourceMap" false) }} + <link rel="stylesheet" href="{{ ($style | minify).RelPermalink }}"> + {{ end }} {{ with .Site.Params.favicon }} <link rel="shortcut icon" href="{{ . }}"> {{ end }} - <noscript><link rel="stylesheet" href='{{ "assets/css/noscript.css" | relURL }}' /></noscript> + {{ $noscript := resources.Get "scss/noscript.scss" | resources.ExecuteAsTemplate "noscript.scss" . | toCSS (dict "targetPath" "assets/css/noscript.css" "enableSourceMap" false) }} + <noscript><link rel="stylesheet" href='{{ $noscript.RelPermalink }}' /></noscript> </head> |