Skip to content

Commit

Permalink
fix: update css.html
Browse files Browse the repository at this point in the history
  • Loading branch information
atsuyaw committed Oct 31, 2023
1 parent 4bed796 commit 4204fd9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions v4/layouts/partials/css.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{{ $options := dict "targetPath" "theme.css" "enableSourceMap" true "precision" 6 }}
{{ $css := resources.Get "sass/theme.scss" | resources.ExecuteAsTemplate "theme.scss" . | toCSS $options }}
{{ $darkOptions := dict "targetPath" "dark-theme.css" "enableSourceMap" true "precision" 6 }}
{{ $darkCss := resources.Get "sass/dark-theme.scss" | resources.ExecuteAsTemplate "dark-theme.scss" . | toCSS $darkOptions }}

{{ $darkOptions := dict "targetPath" "dark-theme.css" "enableSourceMap" true "precision" 6 }}
{{ $darkCss := resources.Get "sass/dark-theme.scss" | resources.ExecuteAsTemplate "dark-theme.scss" . | toCSS $darkOptions }}

{{ if or (.Site.IsServer) (eq hugo.Environment "development") }}
<link rel="stylesheet" href="{{ $css.Permalink }}" media="screen">
<link rel="stylesheet" disabled id="dark-theme-css" href="{{ $darkCss.Permalink }}" media="screen">
<link rel="stylesheet" href="{{ $css.Permalink }}" media="screen">
<link disabled id="dark-theme-css" rel="stylesheet" href="{{ $darkCss.Permalink }}" media="screen">
{{ else }}
{{ $css := $css | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $css.Permalink }}" integrity="{{ $css.Data.Integrity }}" media="screen">
{{ $darkCss := $darkCss | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" disabled id="dark-theme-css" href="{{ $darkCss.Permalink }}" integrity="{{ $css.Data.Integrity }}" media="screen">
{{ $css := $css | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $css.Permalink }}" integrity="{{ $css.Data.Integrity }}" media="screen">
{{ $darkCss := $darkCss | resources.Minify | resources.Fingerprint }}
<link disabled id="dark-theme-css" rel="stylesheet" href="{{ $darkCss.Permalink }}" integrity="{{ $darkCss.Data.Integrity }}" media="screen">
{{ end }}

{{ if isset .Site.Params "css_modules" }}
Expand Down

0 comments on commit 4204fd9

Please sign in to comment.