diff --git a/Makefile b/Makefile index cd026585f0b..5324f7f3899 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,12 @@ # so we have to override the default shell here SHELL=bash -eou pipefail -npm: +# bundle is also executed from other repositories when people run local previews +bundle: npm install -bundle: npm netlify_dart_sass - clean_hugo_mod: - hugo mod clean + hugo mod clean --all clean: rm -rf node_modules @@ -33,16 +32,6 @@ production: bundle deploy_preview: bundle hugo --gc --minify --enableGitInfo --buildFuture -netlify_dart_sass: - # Hugo requires dart-sass to transpile CSS, but Netlify doesn't support it. - # See https://gohugo.io/functions/resources/tocss/#netlify - @DART_SASS_VERSION="1.72.0"; \ - echo $${DART_SASS_VERSION}; \ - curl -LJO https://github.com/sass/dart-sass/releases/download/$${DART_SASS_VERSION}/dart-sass-$${DART_SASS_VERSION}-linux-x64.tar.gz; \ - tar -xf dart-sass-$${DART_SASS_VERSION}-linux-x64.tar.gz; \ - rm dart-sass-$${DART_SASS_VERSION}-linux-x64.tar.gz; \ - export PATH=/opt/build/repo/dart-sass:$$PATH; \ - serve_ignore_vendor: bundle hugo server --buildDrafts --noHTTPCache --buildFuture --ignoreVendorPaths github.com/** diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/head.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/head.html index 6c342a8f051..0e53a7c800a 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/head.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/head.html @@ -13,6 +13,9 @@ {{- end -}} {{- end }} + {{ with .Params.product_version -}} + + {{- end }} {{ .Title }} diff --git a/_vendor/modules.txt b/_vendor/modules.txt index dac2fb2284c..b749c001318 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -14,7 +14,7 @@ # github.com/chef/compliance-profiles/docs-chef-io v0.0.0-20240306070238-713aa7a8dd8e # github.com/chef/compliance-remediation-2022/docs-chef-io v0.0.0-20240313054833-ebbc45209efa # github.com/chef/license-service/docs-chef-io v0.0.0-20231117105514-d3f3d53ba2dd -# github.com/chef/chef-docs-theme v0.0.0-20240320201714-1313815d104f +# github.com/chef/chef-docs-theme v0.0.0-20240325200949-00fdecaf8c51 # github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536 # github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90 # github.com/twitter/hogan.js v3.0.2+incompatible diff --git a/cspell.yaml b/cspell.yaml index 42c15198672..c9845189955 100644 --- a/cspell.yaml +++ b/cspell.yaml @@ -25,14 +25,25 @@ flagWords: - hte ignorePaths: - ".expeditor/**/*" -- "**/*.yml" +- "**/*.sh" +- "**/*.svg" - "**/*.toml" +- "**/*.yml" - archetypes/*.md +- /package*.json - _vendor/**/* - cspell.yaml - public/** - node_modules/** - resources/** +- generated/** +- '*.work' +- '*.work.sum' +- dart-sass/**/* +- tools/**/* +- go.mod +- go.sum +- Makefile # Ignore patterns list # https://cspell.org/configuration/patterns/ @@ -45,5 +56,3 @@ ignoreRegExpList: - "/'d\\b/" - "/^\\s*```[\\s\\S]*?^\\s*```/gm" - "{{(.+)(?=}})" -words: -- Grammarly diff --git a/go.mod b/go.mod index 618beb76102..e26c5e527f7 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/chef/automate/components/docs-chef-io v0.0.0-20240306133449-4e982f867599 // indirect - github.com/chef/chef-docs-theme v0.0.0-20240315155053-d3478940b224 // indirect + github.com/chef/chef-docs-theme v0.0.0-20240325200949-00fdecaf8c51 // indirect github.com/chef/chef-server/docs-chef-io v0.0.0-20240320162132-10d96e306f90 // indirect github.com/chef/chef-workstation/docs-chef-io v0.0.0-20240220152040-faf51299a28a // indirect github.com/chef/compliance-profiles/docs-chef-io v0.0.0-20240306070238-713aa7a8dd8e // indirect diff --git a/go.sum b/go.sum index a3dd27800e7..2d0ef12a132 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chef/automate/components/docs-chef-io v0.0.0-20240306133449-4e982f867599 h1:vya+2EqafWQi5osINw4CRrmoDNfZ3LJjrAplqpMc7eA= github.com/chef/automate/components/docs-chef-io v0.0.0-20240306133449-4e982f867599/go.mod h1:juvLC7Rt33YOCgJ5nnfl4rWZRAbSwqjTbWmcAoA0LtU= -github.com/chef/chef-docs-theme v0.0.0-20240320201714-1313815d104f h1:LXr5PIB1h2zDGt+rFl7kNgha4NBkRKsVr3PB6kjhKPo= -github.com/chef/chef-docs-theme v0.0.0-20240320201714-1313815d104f/go.mod h1:+Jpnv+LXE6dXu2xDcMzMc0RxRGuCPAoFxq5tJ/X6QpQ= +github.com/chef/chef-docs-theme v0.0.0-20240325200949-00fdecaf8c51 h1:GTMxt5u3hnje3qoELAyGtE4V8iL34rZVZ0bqtjCE64I= +github.com/chef/chef-docs-theme v0.0.0-20240325200949-00fdecaf8c51/go.mod h1:+Jpnv+LXE6dXu2xDcMzMc0RxRGuCPAoFxq5tJ/X6QpQ= github.com/chef/chef-server/docs-chef-io v0.0.0-20240320162132-10d96e306f90 h1:zXtajiExlaLQc9d0KVJb5PLNBwcr2GyKixpKeYe2v4M= github.com/chef/chef-server/docs-chef-io v0.0.0-20240320162132-10d96e306f90/go.mod h1:gMSa25GUHmLimA0gjvRd3hs1buOBqkKPrdHzHvaJauY= github.com/chef/chef-workstation/docs-chef-io v0.0.0-20240220152040-faf51299a28a h1:76ZYfDXaaPCMi4YQ4uuhKSUALF488ZNfAcJx9/p+7/I= diff --git a/scripts/local-server.sh b/scripts/local-server.sh index df899314f86..be39c59654d 100644 --- a/scripts/local-server.sh +++ b/scripts/local-server.sh @@ -8,5 +8,5 @@ set -eou pipefail # Run 'netlify dev' ### -pushd themes/docs-new && npm install && popd +npm install hugo server -b localhost:1313 diff --git a/scripts/netlify-branch-deploy.sh b/scripts/netlify-branch-deploy.sh index 968463391da..3297aecb88c 100644 --- a/scripts/netlify-branch-deploy.sh +++ b/scripts/netlify-branch-deploy.sh @@ -7,8 +7,18 @@ set -eou pipefail # https://docs.netlify.com/site-deploys/overview/#branches-and-deploys ### +DART_SASS_VERSION="1.72.0" + echo Branch: $HEAD echo Branch deploy URL: $DEPLOY_PRIME_URL -pushd themes/docs-new && npm install && popd +# Hugo requires dart-sass +# https://gohugo.io/functions/resources/tocss/#netlify + +curl -LJO https://github.com/sass/dart-sass/releases/download/$DART_SASS_VERSION/dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +tar -xf dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +rm dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +export PATH=/opt/build/repo/dart-sass:$PATH + +npm install hugo --gc --minify --enableGitInfo diff --git a/scripts/netlify-deploy-preview.sh b/scripts/netlify-deploy-preview.sh index 92784095772..f8914ced04d 100644 --- a/scripts/netlify-deploy-preview.sh +++ b/scripts/netlify-deploy-preview.sh @@ -5,10 +5,22 @@ set -eou pipefail ### # Generate Netlify build previews for a pull request # https://docs.netlify.com/site-deploys/overview/#branches-and-deploys +# +# This script is also executed by Netlify from other repositories. ### +DART_SASS_VERSION="1.72.0" + echo Branch: $HEAD echo Branch deploy URL: $DEPLOY_PRIME_URL -pushd themes/docs-new && npm install && popd +# Hugo requires dart-sass +# https://gohugo.io/functions/resources/tocss/#netlify + +curl -LJO https://github.com/sass/dart-sass/releases/download/$DART_SASS_VERSION/dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +tar -xf dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +rm dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +export PATH=/opt/build/repo/dart-sass:$PATH + +npm install hugo --gc --minify --enableGitInfo --buildFuture diff --git a/scripts/netlify-deploy-production.sh b/scripts/netlify-deploy-production.sh index c868b73ff41..c5fd8f363f6 100644 --- a/scripts/netlify-deploy-production.sh +++ b/scripts/netlify-deploy-production.sh @@ -7,8 +7,18 @@ set -eou pipefail # https://docs.netlify.com/site-deploys/overview/#branches-and-deploys ### +DART_SASS_VERSION="1.72.0" + echo Branch: $HEAD echo Branch deploy URL: $DEPLOY_PRIME_URL -pushd themes/docs-new && npm install && popd +# Hugo requires dart-sass +# https://gohugo.io/functions/resources/tocss/#netlify + +curl -LJO https://github.com/sass/dart-sass/releases/download/$DART_SASS_VERSION/dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +tar -xf dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +rm dart-sass-$DART_SASS_VERSION-linux-x64.tar.gz +export PATH=/opt/build/repo/dart-sass:$PATH + +npm install hugo --gc --minify --enableGitInfo