diff --git a/config/webpack.dev.js b/config/webpack.dev.js index a7b798f1..935f19b1 100644 --- a/config/webpack.dev.js +++ b/config/webpack.dev.js @@ -3,6 +3,8 @@ const common = require("./webpack.common.js"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const fs = require("fs"); +const htmlLayout = fs.readFileSync("./site/layout.html"); + module.exports = (env, argv) => { // add --mode=production to flip this into a pseudo-production server const emulateProdServer = argv.mode === "production"; @@ -17,22 +19,6 @@ module.exports = (env, argv) => { }, mode: emulateProdServer ? "production" : "development", devtool: emulateProdServer ? false : "inline-source-map", - module: { - rules: [ - { - test: /\.html$/, - use: [ - "html-loader", - { - loader: "liquidjs-loader", - options: { - root: "./site/", - }, - }, - ], - }, - ], - }, devServer: { open: false, host: @@ -51,13 +37,20 @@ module.exports = (env, argv) => { }, plugins: [ // create an html page for every item in ./site/views - ...fs.readdirSync("./site/views").map( - (f) => - new HtmlWebpackPlugin({ - template: "./site/views/" + f, - filename: f, - }) - ), + ...fs.readdirSync("./site/views").map((f) => { + const htmlView = fs.readFileSync( + `./site/views/${f}`, + "utf8" + ); + + return new HtmlWebpackPlugin({ + templateContent: new Function( + ["content"], + `return \`${htmlLayout}\`;` + )(htmlView), + filename: f, + }); + }), ], optimization: { splitChunks: { diff --git a/package-lock.json b/package-lock.json index e5187201..a3e78514 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,6 @@ "husky": "^9.0.11", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "liquidjs-loader": "^1.0.1", "mini-css-extract-plugin": "^2.8.1", "mini-svg-data-uri": "^1.4.4", "postcss": "^8.4.38", @@ -4078,15 +4077,6 @@ "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "dev": true }, - "node_modules/big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -6004,15 +5994,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -9011,33 +8992,6 @@ "uc.micro": "^1.0.1" } }, - "node_modules/liquidjs": { - "version": "9.43.0", - "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-9.43.0.tgz", - "integrity": "sha512-qZZuL5Emja2UgCqiLewiw9bvwZQwm19TTGFxDkonVzB4YSTOZ8tuTVo/7Uu/AeW1cL2Qb/at3DSoV8wwyFXQCw==", - "dev": true, - "bin": { - "liquid": "bin/liquid.js", - "liquidjs": "bin/liquid.js" - }, - "engines": { - "node": ">=4.8.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/liquidjs" - } - }, - "node_modules/liquidjs-loader": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/liquidjs-loader/-/liquidjs-loader-1.0.1.tgz", - "integrity": "sha512-5OmXG5Vphlv7Nvvzn5sZxnGLfFOvt5K6g54gfe52PeiBEUurxDEJqO1hOM+sKa/kivD1SbEs73klHJeiMgZRfA==", - "dev": true, - "dependencies": { - "liquidjs": "^9.16.1", - "loader-utils": "^2.0.0" - } - }, "node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -9093,20 +9047,6 @@ "node": ">=6.11.5" } }, - "node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -16741,12 +16681,6 @@ "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "dev": true }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -18182,12 +18116,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true - }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -20381,22 +20309,6 @@ "uc.micro": "^1.0.1" } }, - "liquidjs": { - "version": "9.43.0", - "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-9.43.0.tgz", - "integrity": "sha512-qZZuL5Emja2UgCqiLewiw9bvwZQwm19TTGFxDkonVzB4YSTOZ8tuTVo/7Uu/AeW1cL2Qb/at3DSoV8wwyFXQCw==", - "dev": true - }, - "liquidjs-loader": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/liquidjs-loader/-/liquidjs-loader-1.0.1.tgz", - "integrity": "sha512-5OmXG5Vphlv7Nvvzn5sZxnGLfFOvt5K6g54gfe52PeiBEUurxDEJqO1hOM+sKa/kivD1SbEs73klHJeiMgZRfA==", - "dev": true, - "requires": { - "liquidjs": "^9.16.1", - "loader-utils": "^2.0.0" - } - }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -20439,17 +20351,6 @@ "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true }, - "loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", diff --git a/package.json b/package.json index d969f03a..e077fed7 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "husky": "^9.0.11", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "liquidjs-loader": "^1.0.1", "mini-css-extract-plugin": "^2.8.1", "mini-svg-data-uri": "^1.4.4", "postcss": "^8.4.38", diff --git a/site/layout.html b/site/layout.html index 97c6169f..4e6bb961 100644 --- a/site/layout.html +++ b/site/layout.html @@ -127,11 +127,7 @@ - {% block content %} -