hacker.tours-website/themes/zen/layouts/partials/styles.html

20 lines
1.2 KiB
HTML
Raw Normal View History

2024-06-13 22:14:05 +02:00
{{ $main_options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" false "transpiler" (site.Params.sassTranspiler | default "libsass")) -}}
{{ if eq hugo.Environment "development" -}}
{{ $main_options = merge $main_options (dict "outputStyle" "nested" "enableSourceMap" true) -}}
{{ end -}}
{{ $mobile_options := merge $main_options (dict "targetPath" "css/mobile.css") -}}
{{ $print_options := merge $main_options (dict "targetPath" "css/print.css") -}}
{{ $main_style := resources.Get "sass/styles.scss" | toCSS $main_options -}}
{{ $mobile_style := resources.Get "sass/mobile.scss" | toCSS $mobile_options -}}
{{ $print_style := resources.Get "sass/print.scss" | toCSS $print_options -}}
{{ if ne hugo.Environment "development" -}}
{{ $main_style = $main_style | fingerprint -}}
{{ $mobile_style = $mobile_style | fingerprint -}}
{{ $print_style = $print_style | fingerprint -}}
{{ end -}}
{{ if $.Param "mobilemenu" -}}
<link rel="stylesheet" href="{{ $mobile_style.RelPermalink }}" media="screen">
{{ end -}}
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
<link rel="stylesheet" href="{{ $print_style.RelPermalink }}" media="print">