Add hugo-installer to site package.json

This installs a local copy of the Hugo binary that we need to build
the site. Otherwise the user would have to install it via their sy-
stem package manager. This also adds a new npm "build:site" script
to build the site using our local version of Hugo.

Note: this is slightly annoying, but after toying with "easier" op-
tions like Hexo that integrate with the JavaScript ecosystem more
naturally, I ended up preferring Hugo anyways. Hexo's not nearly as
powerful or well documented as Hugo.

Note note: there is also the `hugo-bin` package on NPM, but it is
very out of date.
This commit is contained in:
Alan Orth 2021-11-11 14:50:56 +02:00
parent 29c91c4ed4
commit 392a49f854
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 2342 additions and 2 deletions

2337
site/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,10 @@
"scripts": { "scripts": {
"build:css": "sass --style expanded source/scss/style.scss assets/css/style.css.tmp && cleancss -O1 --format breakWith=lf --with-rebase assets/css/style.css.tmp -o assets/css/style.min.css", "build:css": "sass --style expanded source/scss/style.scss assets/css/style.css.tmp && cleancss -O1 --format breakWith=lf --with-rebase assets/css/style.css.tmp -o assets/css/style.min.css",
"build:js": "uglifyjs node_modules/jquery/dist/jquery.slim.min.js node_modules/bootstrap/dist/js/bootstrap.min.js -o assets/js/bundle.min.js", "build:js": "uglifyjs node_modules/jquery/dist/jquery.slim.min.js node_modules/bootstrap/dist/js/bootstrap.min.js -o assets/js/bundle.min.js",
"build": "npm run build:css && npm run build:js && npm run clean", "build:site": "./bin/hugo",
"clean": "rm assets/css/style.css.tmp assets/css/style.css.tmp.map" "build": "npm run build:css && npm run build:js && npm run clean && npm run build:site",
"clean": "rm assets/css/style.css.tmp assets/css/style.css.tmp.map",
"postinstall": "hugo-installer --version 0.89.2"
}, },
"keywords": [ "keywords": [
"ISEAL", "ISEAL",
@ -19,6 +21,7 @@
"devDependencies": { "devDependencies": {
"bootstrap": "^5.1.1", "bootstrap": "^5.1.1",
"clean-css-cli": "^5.3.3", "clean-css-cli": "^5.3.3",
"hugo-installer": "^3.1.0",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"sass": "^1.41.1", "sass": "^1.41.1",
"uglify-js": "^3.14.2" "uglify-js": "^3.14.2"