mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-30 00:29:52 +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:
@@ -8,12 +8,13 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
|
||||
{{- end }}
|
||||
|
||||
{{- if eq (getenv "HUGO_ENV") "production" -}}
|
||||
<script src="/docs/{{ .Site.Params.docs_version }}/assets/js/docs.min.js"></script>
|
||||
{{- else -}}
|
||||
<script src="/docs/{{ .Site.Params.docs_version }}/assets/js/vendor/anchor.min.js"></script>
|
||||
<script src="/docs/{{ .Site.Params.docs_version }}/assets/js/vendor/clipboard.min.js"></script>
|
||||
<script src="/docs/{{ .Site.Params.docs_version }}/assets/js/vendor/bs-custom-file-input.min.js"></script>
|
||||
<script src="/docs/{{ .Site.Params.docs_version }}/assets/js/src/application.js"></script>
|
||||
<script src="/docs/{{ .Site.Params.docs_version }}/assets/js/src/search.js"></script>
|
||||
{{- end -}}
|
||||
{{- $vendor := resources.Match "js/vendor/*.js" -}}
|
||||
{{- $js := resources.Match "js/src/*.js" -}}
|
||||
{{- $targetDocsJSPath := printf "/docs/%s/assets/js/docs.js" .Site.Params.docs_version -}}
|
||||
{{- $docsJs := append $js $vendor | resources.Concat $targetDocsJSPath -}}
|
||||
|
||||
{{- if (eq (getenv "HUGO_ENV") "production") -}}
|
||||
{{- $docsJs = $docsJs | resources.Minify -}}
|
||||
{{- end }}
|
||||
|
||||
<script src="{{ $docsJs.Permalink | relURL }}"></script>
|
||||
|
Reference in New Issue
Block a user