mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-14 02:24:00 +01:00
24f749cb76
Also: * load any docs' third-party dependencies from node_modules (except for examples) * exclude docsearch from layouts that don't use it * preconnect to algolia only when not examples layout * switch to `RelPermalink` * refactor JS assets into partials
24 lines
1.2 KiB
HTML
24 lines
1.2 KiB
HTML
{{ 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 }}>
|
|
{{- else -}}
|
|
<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 -}}
|
|
{{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}}
|
|
|
|
{{ if hugo.IsProduction -}}
|
|
{{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}}
|
|
{{- end -}}
|
|
|
|
{{- $style := resources.Get "scss/docs.scss" | toCSS $sassOptions | postCSS $postcssOptions }}
|
|
|
|
<link href="{{ $style.RelPermalink }}" rel="stylesheet">
|
|
{{- end }}
|