From 129bb08fc4d2c850ae71250371adf82a4441dc70 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 17 Sep 2019 00:22:49 +0300 Subject: 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. --- site/layouts/partials/scripts.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'site/layouts/partials/scripts.html') diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html index 4b909e0e4..0807607e4 100644 --- a/site/layouts/partials/scripts.html +++ b/site/layouts/partials/scripts.html @@ -8,12 +8,13 @@ {{- end }} -{{- if eq (getenv "HUGO_ENV") "production" -}} - -{{- else -}} - - - - - -{{- 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 }} + + -- cgit v1.2.3