stylesheet.html 1.3 KB

123456789101112131415161718192021222324
  1. {{- "<!-- Bootstrap core CSS -->" | safeHTML }}
  2. {{ if eq hugo.Environment "production" -}}
  3. {{ if eq .Page.Params.direction "rtl" -}}
  4. <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">
  5. {{- else -}}
  6. <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">
  7. {{- end -}}
  8. {{- else -}}
  9. <link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap{{ if eq .Page.Params.direction "rtl" }}.rtl{{ end }}.css" rel="stylesheet">
  10. {{- end }}
  11. {{- if (ne .Page.Layout "examples") }}
  12. {{- $targetDocsCssPath := printf "/docs/%s/assets/css/docs.css" .Site.Params.docs_version -}}
  13. {{- $sassOptions := dict "targetPath" $targetDocsCssPath "outputStyle" "expanded" "precision" 6 -}}
  14. {{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}}
  15. {{ if eq hugo.Environment "production" -}}
  16. {{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}}
  17. {{- end -}}
  18. {{- $style := resources.Get "scss/docs.scss" | toCSS $sassOptions | postCSS $postcssOptions }}
  19. <link href="{{ $style.Permalink | relURL }}" rel="stylesheet">
  20. {{- end }}