mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-08 20:50:44 +02:00
Use Hugo for our docs Sass and JS. (#29280)
Now there's only one command needed to run the docs: `npm run docs-serve`. Also, simplify the npm scripts.
This commit is contained in:
@@ -9,6 +9,17 @@
|
||||
{{- "<!-- Documentation extras -->" | safeHTML }}
|
||||
<link href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" rel="stylesheet">
|
||||
{{- end -}}
|
||||
|
||||
{{- if (ne .Page.Layout "examples") }}
|
||||
<link href="/docs/{{ .Site.Params.docs_version }}/assets/css/docs.min.css" rel="stylesheet">
|
||||
{{- $targetDocsCssPath := printf "/docs/%s/assets/css/docs.css" .Site.Params.docs_version -}}
|
||||
{{- $sassOptions := dict "targetPath" $targetDocsCssPath "precision" 6 -}}
|
||||
{{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}}
|
||||
|
||||
{{- if (eq (getenv "HUGO_ENV") "production") -}}
|
||||
{{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $style := resources.Get "scss/docs.scss" | toCSS $sassOptions | postCSS $postcssOptions }}
|
||||
|
||||
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}">
|
||||
{{- end }}
|
||||
|
Reference in New Issue
Block a user