From df588b23914e75161ed7d36abe1304e708abcdb0 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 21 Feb 2022 16:42:29 -0500 Subject: [PATCH 1/3] Add support for Bootstrap and FontAwesome via NPM packages - Add FA npm package @5.15.4 - Add bootstrap@4.6.1 - Edit NPM scripts: drop submodule scripts --- config.toml | 20 +++++++++++++++++++- package.json | 8 +++++--- userguide/package.json | 9 +-------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/config.toml b/config.toml index 406ed0f762..b65928176f 100644 --- a/config.toml +++ b/config.toml @@ -29,4 +29,22 @@ permalinkable = false [module] [module.hugoVersion] extended = true -min = "0.73.0" \ No newline at end of file +min = "0.73.0" + [[module.mounts]] + source = 'assets' + target = 'assets' + [[module.mounts]] + source = 'node_modules/bootstrap' + target = 'assets/vendor/bootstrap' + [[module.mounts]] + source = 'node_modules/@fortawesome/fontawesome-free' + target = 'assets/vendor/Font-Awesome' + [[module.mounts]] + source = "i18n" + target = "i18n" + [[module.mounts]] + source = 'layouts' + target = 'layouts' + [[module.mounts]] + source = 'static' + target = 'static' diff --git a/package.json b/package.json index 77883e6309..3d5028dbf9 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,11 @@ "build": "npm run _docs build", "docs-install": "cd userguide && npm install", "predocs-install": "npm install", - "serve": "npm run _docs serve", - "submodule:get": "git submodule update --init --recursive --depth 1", - "submodule:update": "git submodule update --remote --recursive --depth 1" + "serve": "npm run _docs serve" + }, + "dependencies": { + "@fortawesome/fontawesome-free": "^5.15.4", + "bootstrap": "^4.6.1" }, "devDependencies": { "hugo-extended": "0.92.2" diff --git a/userguide/package.json b/userguide/package.json index c6e547ea4b..a84c56cc12 100644 --- a/userguide/package.json +++ b/userguide/package.json @@ -7,14 +7,7 @@ "build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"", "build:production": "npm run _hugo -- --minify", "build": "npm run _build", - "prebuild:preview": "npm run submodule:get", - "prebuild:production": "npm run submodule:get", - "prebuild": "npm run submodule:get", - "preinstall": "npm run submodule:get", - "preserve": "npm run submodule:get", - "serve": "npm run _serve", - "submodule:get": "cd .. && npm run submodule:get", - "submodule:update": "cd .. && npm run submodule:update" + "serve": "npm run _serve" }, "devDependencies": { "autoprefixer": "^9.5.0", From 8939f696d4a54a5cf77a3edf4c39ee6a37886e08 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 21 Feb 2022 16:49:55 -0500 Subject: [PATCH 2/3] Ensure that UG isn't built using the BS and FA submodules --- userguide/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userguide/package.json b/userguide/package.json index a84c56cc12..82a7e5ab3a 100644 --- a/userguide/package.json +++ b/userguide/package.json @@ -1,7 +1,7 @@ { "scripts": { "_build": "npm run _hugo-dev", - "_hugo": "hugo --cleanDestinationDir --themesDir ../..", + "_hugo": "rm -Rf ../assets/vendor && hugo --cleanDestinationDir --themesDir ../..", "_hugo-dev": "npm run _hugo -- -e dev -DFE", "_serve": "npm run _hugo-dev -- serve", "build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"", From 7b4c15e490fb8dd9eb2ffea447e83335cbc8103a Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 22 Feb 2022 07:49:18 -0500 Subject: [PATCH 3/3] CI: use `prepare` instead of preinstall for the UG --- package.json | 1 - userguide/package.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3d5028dbf9..9aecea9337 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "build:production": "npm run _docs build:production", "build": "npm run _docs build", "docs-install": "cd userguide && npm install", - "predocs-install": "npm install", "serve": "npm run _docs serve" }, "dependencies": { diff --git a/userguide/package.json b/userguide/package.json index 82a7e5ab3a..94ac0086da 100644 --- a/userguide/package.json +++ b/userguide/package.json @@ -7,6 +7,7 @@ "build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"", "build:production": "npm run _hugo -- --minify", "build": "npm run _build", + "prepare": "cd .. && npm install", "serve": "npm run _serve" }, "devDependencies": {