-
Notifications
You must be signed in to change notification settings - Fork 911
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
50 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
{{ $scssMain := "scss/main.scss" -}} | ||
{{ $css := resources.Get $scssMain | ||
| toCSS (dict "enableSourceMap" (not hugo.IsProduction)) -}} | ||
{{ $rtlCSS := | ||
cond (eq .Site.Language.LanguageDirection "rtl") | ||
(resources.Get "vendor/bootstrap/dist/css/bootstrap.rtl.css") | ||
nil -}} | ||
|
||
{{ if hugo.IsProduction -}} | ||
{{ with $rtlCSS -}} | ||
{{ $rtlCSS = . | postCSS | minify | fingerprint -}} | ||
{{ end -}} | ||
{{ $css = $css | postCSS | minify | fingerprint -}} | ||
<link rel="preload" href="{{ $css.RelPermalink }}" as="style"> | ||
{{- end -}} | ||
|
||
{{/* NOTE: when not in production, we don't apply `postCSS`. This makes it | ||
snappier to develop in Chrome, but makes it look sub-optimal in other browsers. | ||
*/ -}} | ||
|
||
{{ $scssMain := "scss/main.scss"}} | ||
{{ if not hugo.IsProduction }} | ||
{{/* Note the missing postCSS. This makes it snappier to develop in Chrome, but makes it look sub-optimal in other browsers. */}} | ||
{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" true) }} | ||
<link href="{{ $css.RelPermalink }}" rel="stylesheet"> | ||
{{ else }} | ||
{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" false) | postCSS | minify | fingerprint }} | ||
<link rel="preload" href="{{ $css.RelPermalink }}" as="style"> | ||
<link href="{{ $css.RelPermalink }}" rel="stylesheet" integrity="{{ $css.Data.integrity }}"> | ||
{{ end }} | ||
|
||
{{ with $rtlCSS -}} | ||
<link href="{{ $rtlCSS.RelPermalink }}" rel="stylesheet"> | ||
{{ end -}} | ||
|
||
{{- /**/ -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters