diff options
| author | Bobby <[email protected]> | 2024-08-16 20:47:33 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-08-16 20:47:33 -0400 |
| commit | 6b28433d9cfde435be8ec2bd6cf91e6324d08865 (patch) | |
| tree | 8343c27b8b95ff5639233e81cf157f92e5688466 /site/layouts/partials/stylesheet.html | |
| parent | d53094ec16ba385faae2973ddee648698b32ab24 (diff) | |
| parent | 048f56f51460df75e92a2f7b472e1c56baeb68f7 (diff) | |
| download | bootstrap-6b28433d9cfde435be8ec2bd6cf91e6324d08865.tar.xz bootstrap-6b28433d9cfde435be8ec2bd6cf91e6324d08865.zip | |
Diffstat (limited to 'site/layouts/partials/stylesheet.html')
| -rw-r--r-- | site/layouts/partials/stylesheet.html | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/site/layouts/partials/stylesheet.html b/site/layouts/partials/stylesheet.html index cc4473383..9969ee44f 100644 --- a/site/layouts/partials/stylesheet.html +++ b/site/layouts/partials/stylesheet.html @@ -1,24 +1,27 @@ -{{- "<!-- Bootstrap core CSS -->" | safeHTML }} -{{ if eq hugo.Environment "production" -}} +{{ if hugo.IsProduction -}} {{ if eq .Page.Params.direction "rtl" -}} -<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.rtl.min.css" rel="stylesheet" {{ printf "integrity=%q" .Site.Params.cdn.css_rtl_hash | safeHTMLAttr }} crossorigin="anonymous"> +<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.rtl.min.css" rel="stylesheet" {{ printf "integrity=%q" .Site.Params.cdn.css_rtl_hash | safeHTMLAttr }}> {{- else -}} -<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.min.css" rel="stylesheet" {{ printf "integrity=%q" .Site.Params.cdn.css_hash | safeHTMLAttr }} crossorigin="anonymous"> +<link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.min.css" rel="stylesheet" {{ printf "integrity=%q" .Site.Params.cdn.css_hash | safeHTMLAttr }}> {{- end -}} {{- else -}} <link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap{{ if eq .Page.Params.direction "rtl" }}.rtl{{ end }}.css" rel="stylesheet"> {{- end }} {{- if (ne .Page.Layout "examples") }} -{{- $targetDocsCssPath := path.Join "/docs" .Site.Params.docs_version "assets/css/docs.css" -}} -{{- $sassOptions := dict "targetPath" $targetDocsCssPath "outputStyle" "expanded" "precision" 6 -}} +{{- $sassOptions := dict "outputStyle" "expanded" "precision" 6 -}} {{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}} -{{ if eq hugo.Environment "production" -}} +{{- $targetDocsCssPath := path.Join "/docs" .Site.Params.docs_version "assets/css/docs.css" -}} +{{- $targetSearchCssPath := path.Join "/docs" .Site.Params.docs_version "assets/css/search.css" -}} + +{{ if hugo.IsProduction -}} {{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}} {{- end -}} -{{- $style := resources.Get "scss/docs.scss" | toCSS $sassOptions | postCSS $postcssOptions }} +{{- $docsCss := resources.Get "scss/docs.scss" | toCSS (merge (dict "targetPath" $targetDocsCssPath) $sassOptions) | postCSS $postcssOptions -}} +{{- $searchCss := resources.Get "scss/search.scss" | toCSS (merge (dict "targetPath" $targetSearchCssPath) $sassOptions) | postCSS $postcssOptions -}} -<link href="{{ $style.Permalink | relURL }}" rel="stylesheet"> +<link href="{{ $docsCss.RelPermalink }}" rel="stylesheet"> +<link href="{{ $searchCss.RelPermalink }}" rel="stylesheet"> {{- end }} |
