From f1fa5c5936558ff0b62d8a150bf303629bf50840 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Wed, 30 Jun 2021 15:16:45 +0200 Subject: [PATCH 01/12] feat: add mermaid --- assets/js/mermaid.js | 10 + assets/scss/app.scss | 1 + assets/scss/components/_diagrams.scss | 8 + config/_default/config.toml | 6 + config/_default/params.toml | 1 + config/postcss.config.js | 1 + content/docs/prologue/quick-start.md | 88 ++++ layouts/partials/footer/script-footer.html | 15 + layouts/shortcodes/mermaid.html | 3 + package-lock.json | 474 +++------------------ package.json | 2 +- 11 files changed, 184 insertions(+), 425 deletions(-) create mode 100644 assets/js/mermaid.js create mode 100644 assets/scss/components/_diagrams.scss create mode 100644 layouts/shortcodes/mermaid.html diff --git a/assets/js/mermaid.js b/assets/js/mermaid.js new file mode 100644 index 0000000..b6d3bfd --- /dev/null +++ b/assets/js/mermaid.js @@ -0,0 +1,10 @@ +var config = { + theme: 'default', + fontFamily: '"Jost", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";', +}; + +/* eslint-disable no-undef */ + +mermaid.initialize(config); + +/* eslint-enable no-undef */ diff --git a/assets/scss/app.scss b/assets/scss/app.scss index 9086c5b..dea62e6 100644 --- a/assets/scss/app.scss +++ b/assets/scss/app.scss @@ -22,6 +22,7 @@ @import "components/code"; @import "components/syntax"; @import "components/comments"; +@import "components/diagrams"; @import "components/forms"; @import "components/images"; @import "components/search"; diff --git a/assets/scss/components/_diagrams.scss b/assets/scss/components/_diagrams.scss new file mode 100644 index 0000000..3ff2488 --- /dev/null +++ b/assets/scss/components/_diagrams.scss @@ -0,0 +1,8 @@ +.mermaid { + margin: 1.5rem 0; + padding: 1.5rem; +} + +.mermaid svg { + height: auto; +} diff --git a/config/_default/config.toml b/config/_default/config.toml index 0b93b14..c87068f 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -89,3 +89,9 @@ rel = "sitemap" [[module.mounts]] source = "node_modules/katex" target = "assets/js/vendor/katex" + [[module.mounts]] + source = "node_modules/mermaid" + target = "assets/js/vendor/mermaid" + [[module.mounts]] + source = "node_modules/mermaid" + target = "static/js/vendor/mermaid" diff --git a/config/_default/params.toml b/config/_default/params.toml index 9601055..c571bf4 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -72,3 +72,4 @@ editPage = false highLight = true kaTex = false collapsibleSidebar = false + mermaid = true diff --git a/config/postcss.config.js b/config/postcss.config.js index 0155a41..4b26fa1 100644 --- a/config/postcss.config.js +++ b/config/postcss.config.js @@ -22,6 +22,7 @@ module.exports = { ...whitelister([ './assets/scss/components/_buttons.scss', './assets/scss/components/_code.scss', + './assets/scss/components/_diagrams.scss', './assets/scss/components/_syntax.scss', './assets/scss/components/_search.scss', './assets/scss/common/_dark.scss', diff --git a/content/docs/prologue/quick-start.md b/content/docs/prologue/quick-start.md index 9282d3e..817c5f7 100644 --- a/content/docs/prologue/quick-start.md +++ b/content/docs/prologue/quick-start.md @@ -13,6 +13,94 @@ weight: 110 toc: true --- +## Flow + +{{< mermaid class="bg-light text-center">}} +graph TD + A[Hard] -->|Text| B(Round) + B --> C{Decision} + C -->|One| D[Result 1] + C -->|Two| E[Result 2] +{{< /mermaid >}} + +## Sequence + +{{< mermaid >}} +sequenceDiagram + Alice->>John: Hello John, how are you? + loop Healthcheck + John->>John: Fight against hypochondria + end + Note right of John: Rational thoughts! + John-->>Alice: Great! + John->>Bob: How about you? + Bob-->>John: Jolly good! +{{< /mermaid >}} + +## Gantt + +{{< mermaid >}} +gantt + section Section + Completed :done, des1, 2014-01-06,2014-01-08 + Active :active, des2, 2014-01-07, 3d + Parallel 1 : des3, after des1, 1d + Parallel 2 : des4, after des1, 1d + Parallel 3 : des5, after des3, 1d + Parallel 4 : des6, after des4, 1d +{{< /mermaid >}} + +## Class + +{{< mermaid >}} +classDiagram + classA --|> classB : Inheritance + classC --* classD : Composition + classE --o classF : Aggregation + classG --> classH : Association + classI -- classJ : Link(Solid) + classK ..> classL : Dependency + classM ..|> classN : Realization + classO .. classP : Link(Dashed) +{{< /mermaid >}} + +## State + +{{< mermaid >}} +stateDiagram-v2 + [*] --> Still + Still --> [*] + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] +{{< /mermaid >}} + +## Pie + +{{< mermaid >}} +pie + title Key elements in Product X + "Calcium" : 42.96 + "Potassium" : 50.05 + "Magnesium" : 10.01 + "Iron" : 5 +{{< /mermaid >}} + +## User Journey + +{{< mermaid >}} +journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + section Go home + Go downstairs: 5: Me + Sit down: 3: Me +{{< /mermaid >}} + ## Requirements Doks uses npm to centralize dependency management, making it [easy to update]({{< relref "how-to-update" >}}) resources, build tooling, plugins, and build scripts: diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html index 76cf0d5..4238c15 100644 --- a/layouts/partials/footer/script-footer.html +++ b/layouts/partials/footer/script-footer.html @@ -10,6 +10,8 @@ {{ $katex := resources.Get "js/vendor/katex/dist/katex.js" -}} {{ $katexAutoRender := resources.Get "js/vendor/katex/dist/contrib/auto-render.js" -}} +{{ $mermaid := resources.Get "js/vendor/mermaid/dist/mermaid.min.js" -}} + {{ $app := resources.Get "js/app.js" -}} {{ $slice := slice $app -}} @@ -49,6 +51,12 @@ {{ $slice = $slice | append $katexConfig -}} {{ end -}} +{{ if .Site.Params.options.mermaid -}} + {{ $mermaidConfig := resources.Get "js/mermaid.js" -}} + {{ $mermaidConfig := $mermaidConfig | js.Build -}} + {{ $slice = $slice | append $mermaidConfig -}} +{{ end -}} + {{ $js := $slice | resources.Concat "main.js" -}} {{ if eq (hugo.Environment) "development" -}} @@ -62,6 +70,9 @@ {{ end -}} + {{ if .Site.Params.options.mermaid -}} + + {{ end -}} {{ if .Site.Params.options.flexSearch -}} @@ -73,6 +84,7 @@ {{ $highlight := $highlight | minify | fingerprint "sha512" -}} {{ $katex := $katex | minify | fingerprint "sha512" -}} {{ $katexAutoRender := $katexAutoRender | minify | fingerprint "sha512" -}} + {{ $mermaid := $mermaid | minify | fingerprint "sha512" -}} {{ if .Site.Params.options.bootStrapJs -}} {{ end -}} @@ -83,6 +95,9 @@ {{ end -}} + {{ if .Site.Params.options.mermaid -}} + + {{ end -}} {{ if .Site.Params.options.flexSearch -}} diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html new file mode 100644 index 0000000..d26624e --- /dev/null +++ b/layouts/shortcodes/mermaid.html @@ -0,0 +1,3 @@ +
+ {{- .Inner -}} +
\ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cb2596d..c46a6bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "katex": "^0.13", "lazysizes": "^5.3", "markdownlint-cli": "^0.27", - "mermaid": "^8.10.2", + "mermaid": "^8.11", "postcss": "^8.3", "postcss-cli": "^8.3", "purgecss-whitelister": "^2.4", @@ -1813,9 +1813,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "15.12.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.4.tgz", - "integrity": "sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA==", + "version": "15.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.5.tgz", + "integrity": "sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -2378,12 +2378,6 @@ "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "dev": true }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "node_modules/cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -2469,16 +2463,6 @@ "node": ">=6" } }, - "node_modules/camel-case": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", - "dev": true, - "dependencies": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } - }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -2515,9 +2499,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001239", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001239.tgz", - "integrity": "sha512-cyBkXJDMeI4wthy8xJ2FvDU6+0dtcZSJW3voUF8+e9f1bBeuvyZfc3PNbkOETyhbR+dGCPzn9E7MA3iwzusOhQ==", + "version": "1.0.30001241", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001241.tgz", + "integrity": "sha512-1uoSZ1Pq1VpH0WerIMqwptXHNNGfdl7d1cJUFs80CwQ/lVzdhTvsFZCeNFslze7AjsQnb4C85tzclPa1VShbeQ==", "dev": true, "funding": { "type": "opencollective", @@ -2760,27 +2744,6 @@ "node": ">=0.10.0" } }, - "node_modules/clean-css": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", - "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", - "dev": true, - "dependencies": { - "source-map": "~0.6.0" - }, - "engines": { - "node": ">= 4.0" - } - }, - "node_modules/clean-css/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -2910,9 +2873,9 @@ } }, "node_modules/core-js-compat": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.15.1.tgz", - "integrity": "sha512-xGhzYMX6y7oEGQGAJmP2TmtBLvR4nZmRGEcFa3ubHOq5YEp51gGN9AovVa0AoujGZIq+Wm6dISiYyGNfdflYww==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.15.2.tgz", + "integrity": "sha512-Wp+BJVvwopjI+A1EFqm2dwUmWYXrvucmtIB2LgXn/Rb+gWPKYxtmb4GKHGKG/KGF1eK9jfjzT38DITbTOCX/SQ==", "dev": true, "dependencies": { "browserslist": "^4.16.6", @@ -2968,18 +2931,6 @@ "node": ">= 8" } }, - "node_modules/css-b64-images": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/css-b64-images/-/css-b64-images-0.2.5.tgz", - "integrity": "sha1-QgBdgyBLK0pdk7axpWRBM7WSegI=", - "dev": true, - "bin": { - "css-b64-images": "bin/css-b64-images" - }, - "engines": { - "node": "*" - } - }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -3697,9 +3648,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.3.758", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.758.tgz", - "integrity": "sha512-StYtiDbgZdjcck3OLwsVVVif7QDuD5m5v2gF+XpETp5lHa7X0y3129YBlYaHRPyj1fep1oAaC6i//gAdp+rhbw==", + "version": "1.3.762", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.762.tgz", + "integrity": "sha512-LehWjRpfPcK8F1Lf/NZoAwWLWnjJVo0SZeQ9j/tvnBWYcT99qDqgo4raAfS2oTKZjPrR/jxruh85DGgDUmywEA==", "dev": true }, "node_modules/emoji-regex": { @@ -4285,17 +4236,16 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz", + "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" }, "engines": { "node": ">=8" @@ -5084,33 +5034,6 @@ "node": ">=10" } }, - "node_modules/html-minifier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", - "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", - "dev": true, - "dependencies": { - "camel-case": "^3.0.0", - "clean-css": "^4.2.1", - "commander": "^2.19.0", - "he": "^1.2.0", - "param-case": "^2.1.1", - "relateurl": "^0.2.7", - "uglify-js": "^3.5.1" - }, - "bin": { - "html-minifier": "cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/html-minifier/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "node_modules/html-tags": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz", @@ -6066,12 +5989,6 @@ "loose-envify": "cli.js" } }, - "node_modules/lower-case": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", - "dev": true - }, "node_modules/lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -6360,9 +6277,9 @@ } }, "node_modules/mermaid": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.10.2.tgz", - "integrity": "sha512-Za5MrbAOMbEsyY4ONgGjfYz06sbwF1iNGRzp1sQqpOtvXxjxGu/J1jRJ8QyE9kD/D9zj1/KlRrYegWEvA7eZ5Q==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.11.0.tgz", + "integrity": "sha512-c/SprR4mJ2Pj7A+3mEvva7XrhEkXQJUal7fIyOkMhOhsPX2u5gQjjm5CEhHQ6WdGsqP+yiR+Fcgnd1i8mpFK8w==", "dev": true, "dependencies": { "@braintree/sanitize-url": "^3.1.0", @@ -6371,9 +6288,7 @@ "dagre-d3": "^0.6.4", "entity-decode": "^2.0.2", "graphlib": "^2.1.7", - "he": "^1.2.0", "khroma": "^1.1.0", - "minify": "^4.1.1", "moment-mini": "^2.22.1", "stylis": "^3.5.2" } @@ -6478,27 +6393,6 @@ "node": ">=4" } }, - "node_modules/minify": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/minify/-/minify-4.1.3.tgz", - "integrity": "sha512-ykuscavxivSmVpcCzsXmsVTukWYLUUtPhHj0w2ILvHDGqC+hsuTCihBn9+PJBd58JNvWTNg9132J9nrrI2anzA==", - "dev": true, - "dependencies": { - "clean-css": "^4.1.6", - "css-b64-images": "~0.2.5", - "debug": "^4.1.0", - "html-minifier": "^4.0.0", - "terser": "^4.0.0", - "try-catch": "^2.0.0", - "try-to-catch": "^1.0.2" - }, - "bin": { - "minify": "bin/minify.js" - }, - "engines": { - "node": ">= 8.0.0" - } - }, "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -6663,15 +6557,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/no-case": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "dev": true, - "dependencies": { - "lower-case": "^1.1.1" - } - }, "node_modules/node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", @@ -6995,15 +6880,6 @@ "node": ">=6" } }, - "node_modules/param-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", - "dev": true, - "dependencies": { - "no-case": "^2.2.0" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -8019,15 +7895,6 @@ "jsesc": "bin/jsesc" } }, - "node_modules/relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/remark": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", @@ -8612,25 +8479,6 @@ "urix": "^0.1.0" } }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-url": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", @@ -9368,38 +9216,6 @@ "node": ">= 0.8.0" } }, - "node_modules/terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/terser/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/terser/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -9522,21 +9338,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/try-catch": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/try-catch/-/try-catch-2.0.1.tgz", - "integrity": "sha512-LsOrmObN/2WdM+y2xG+t16vhYrQsnV8wftXIcIOWZhQcBJvKGYuamJGwnU98A7Jxs2oZNkJztXlphEOoA0DWqg==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/try-to-catch": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/try-to-catch/-/try-to-catch-1.1.1.tgz", - "integrity": "sha512-ikUlS+/BcImLhNYyIgZcEmq4byc31QpC+46/6Jm5ECWkVFhf8SM2Fp/0pMVXPX6vk45SMCwrP4Taxucne8I0VA==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -9577,10 +9378,11 @@ "dev": true }, "node_modules/uglify-js": { - "version": "3.13.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", - "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", + "version": "3.13.10", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.10.tgz", + "integrity": "sha512-57H3ACYFXeo1IaZ1w02sfA71wI60MGco/IQFjOqK+WtKoprh7Go2/yvd2HPtoJILO2Or84ncLccI4xoHMTSbGg==", "dev": true, + "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" }, @@ -9812,12 +9614,6 @@ "yarn": "*" } }, - "node_modules/upper-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", - "dev": true - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -11359,9 +11155,9 @@ "dev": true }, "@types/node": { - "version": "15.12.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.4.tgz", - "integrity": "sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA==", + "version": "15.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.5.tgz", + "integrity": "sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==", "dev": true }, "@types/normalize-package-data": { @@ -11776,12 +11572,6 @@ "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -11848,16 +11638,6 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "camel-case": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", - "dev": true, - "requires": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } - }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -11884,9 +11664,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001239", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001239.tgz", - "integrity": "sha512-cyBkXJDMeI4wthy8xJ2FvDU6+0dtcZSJW3voUF8+e9f1bBeuvyZfc3PNbkOETyhbR+dGCPzn9E7MA3iwzusOhQ==", + "version": "1.0.30001241", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001241.tgz", + "integrity": "sha512-1uoSZ1Pq1VpH0WerIMqwptXHNNGfdl7d1cJUFs80CwQ/lVzdhTvsFZCeNFslze7AjsQnb4C85tzclPa1VShbeQ==", "dev": true }, "chalk": { @@ -12069,23 +11849,6 @@ } } }, - "clean-css": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", - "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", - "dev": true, - "requires": { - "source-map": "~0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -12200,9 +11963,9 @@ "optional": true }, "core-js-compat": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.15.1.tgz", - "integrity": "sha512-xGhzYMX6y7oEGQGAJmP2TmtBLvR4nZmRGEcFa3ubHOq5YEp51gGN9AovVa0AoujGZIq+Wm6dISiYyGNfdflYww==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.15.2.tgz", + "integrity": "sha512-Wp+BJVvwopjI+A1EFqm2dwUmWYXrvucmtIB2LgXn/Rb+gWPKYxtmb4GKHGKG/KGF1eK9jfjzT38DITbTOCX/SQ==", "dev": true, "requires": { "browserslist": "^4.16.6", @@ -12247,12 +12010,6 @@ "which": "^2.0.1" } }, - "css-b64-images": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/css-b64-images/-/css-b64-images-0.2.5.tgz", - "integrity": "sha1-QgBdgyBLK0pdk7axpWRBM7WSegI=", - "dev": true - }, "cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -12876,9 +12633,9 @@ } }, "electron-to-chromium": { - "version": "1.3.758", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.758.tgz", - "integrity": "sha512-StYtiDbgZdjcck3OLwsVVVif7QDuD5m5v2gF+XpETp5lHa7X0y3129YBlYaHRPyj1fep1oAaC6i//gAdp+rhbw==", + "version": "1.3.762", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.762.tgz", + "integrity": "sha512-LehWjRpfPcK8F1Lf/NZoAwWLWnjJVo0SZeQ9j/tvnBWYcT99qDqgo4raAfS2oTKZjPrR/jxruh85DGgDUmywEA==", "dev": true }, "emoji-regex": { @@ -13335,17 +13092,16 @@ "dev": true }, "fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz", + "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" }, "dependencies": { "braces": { @@ -13956,29 +13712,6 @@ "lru-cache": "^6.0.0" } }, - "html-minifier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", - "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", - "dev": true, - "requires": { - "camel-case": "^3.0.0", - "clean-css": "^4.2.1", - "commander": "^2.19.0", - "he": "^1.2.0", - "param-case": "^2.1.1", - "relateurl": "^0.2.7", - "uglify-js": "^3.5.1" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - } - } - }, "html-tags": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz", @@ -14731,12 +14464,6 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "lower-case": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", - "dev": true - }, "lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -14958,9 +14685,9 @@ "dev": true }, "mermaid": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.10.2.tgz", - "integrity": "sha512-Za5MrbAOMbEsyY4ONgGjfYz06sbwF1iNGRzp1sQqpOtvXxjxGu/J1jRJ8QyE9kD/D9zj1/KlRrYegWEvA7eZ5Q==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.11.0.tgz", + "integrity": "sha512-c/SprR4mJ2Pj7A+3mEvva7XrhEkXQJUal7fIyOkMhOhsPX2u5gQjjm5CEhHQ6WdGsqP+yiR+Fcgnd1i8mpFK8w==", "dev": true, "requires": { "@braintree/sanitize-url": "^3.1.0", @@ -14969,9 +14696,7 @@ "dagre-d3": "^0.6.4", "entity-decode": "^2.0.2", "graphlib": "^2.1.7", - "he": "^1.2.0", "khroma": "^1.1.0", - "minify": "^4.1.1", "moment-mini": "^2.22.1", "stylis": "^3.5.2" } @@ -15050,21 +14775,6 @@ "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true }, - "minify": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/minify/-/minify-4.1.3.tgz", - "integrity": "sha512-ykuscavxivSmVpcCzsXmsVTukWYLUUtPhHj0w2ILvHDGqC+hsuTCihBn9+PJBd58JNvWTNg9132J9nrrI2anzA==", - "dev": true, - "requires": { - "clean-css": "^4.1.6", - "css-b64-images": "~0.2.5", - "debug": "^4.1.0", - "html-minifier": "^4.0.0", - "terser": "^4.0.0", - "try-catch": "^2.0.0", - "try-to-catch": "^1.0.2" - } - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -15202,15 +14912,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "no-case": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "dev": true, - "requires": { - "lower-case": "^1.1.1" - } - }, "node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", @@ -15453,15 +15154,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "param-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", - "dev": true, - "requires": { - "no-case": "^2.2.0" - } - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -16214,12 +15906,6 @@ } } }, - "relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", - "dev": true - }, "remark": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", @@ -16674,24 +16360,6 @@ "urix": "^0.1.0" } }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "source-map-url": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", @@ -17287,31 +16955,6 @@ "xtend": "^4.0.0" } }, - "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -17411,18 +17054,6 @@ "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", "dev": true }, - "try-catch": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/try-catch/-/try-catch-2.0.1.tgz", - "integrity": "sha512-LsOrmObN/2WdM+y2xG+t16vhYrQsnV8wftXIcIOWZhQcBJvKGYuamJGwnU98A7Jxs2oZNkJztXlphEOoA0DWqg==", - "dev": true - }, - "try-to-catch": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/try-to-catch/-/try-to-catch-1.1.1.tgz", - "integrity": "sha512-ikUlS+/BcImLhNYyIgZcEmq4byc31QpC+46/6Jm5ECWkVFhf8SM2Fp/0pMVXPX6vk45SMCwrP4Taxucne8I0VA==", - "dev": true - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -17454,10 +17085,11 @@ "dev": true }, "uglify-js": { - "version": "3.13.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", - "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", - "dev": true + "version": "3.13.10", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.10.tgz", + "integrity": "sha512-57H3ACYFXeo1IaZ1w02sfA71wI60MGco/IQFjOqK+WtKoprh7Go2/yvd2HPtoJILO2Or84ncLccI4xoHMTSbGg==", + "dev": true, + "optional": true }, "unbzip2-stream": { "version": "1.4.3", @@ -17619,12 +17251,6 @@ "dev": true, "optional": true }, - "upper-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", - "dev": true - }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 62f7500..765f9ff 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "katex": "^0.13", "lazysizes": "^5.3", "markdownlint-cli": "^0.27", - "mermaid": "^8.10.2", + "mermaid": "^8.11", "postcss": "^8.3", "postcss-cli": "^8.3", "purgecss-whitelister": "^2.4", From f7867376fb83a89c9bfb0a99c95b3941f567d252 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Wed, 30 Jun 2021 15:20:56 +0200 Subject: [PATCH 02/12] fix: update content security policy --- layouts/index.headers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/index.headers b/layouts/index.headers index 31746da..ce35f41 100644 --- a/layouts/index.headers +++ b/layouts/index.headers @@ -2,7 +2,7 @@ Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block - Content-Security-Policy: default-src 'self'; frame-ancestors https://jamstackthemes.dev; manifest-src 'self'; connect-src 'self'; font-src 'self'; img-src 'self' data:; script-src 'self'; style-src 'self' + Content-Security-Policy: default-src 'self'; frame-ancestors https://jamstackthemes.dev; manifest-src 'self'; connect-src 'self'; font-src 'self'; img-src 'self' data:; script-src 'self'; style-src 'self' 'unsafe-inline' X-Frame-Options: SAMEORIGIN Referrer-Policy: strict-origin Feature-Policy: geolocation 'self' From b7eda8559341e2b2765abc0a906375c4dcb2f8e9 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Wed, 30 Jun 2021 20:32:28 +0200 Subject: [PATCH 03/12] feat: update mermaid shortcode --- assets/js/mermaid.js | 8 +++---- config/_default/config.toml | 3 --- content/docs/prologue/quick-start.md | 33 +++++++++++++++++++++------- layouts/shortcodes/mermaid.html | 11 +++++++--- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/assets/js/mermaid.js b/assets/js/mermaid.js index b6d3bfd..7831e65 100644 --- a/assets/js/mermaid.js +++ b/assets/js/mermaid.js @@ -3,8 +3,6 @@ var config = { fontFamily: '"Jost", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";', }; -/* eslint-disable no-undef */ - -mermaid.initialize(config); - -/* eslint-enable no-undef */ +document.addEventListener('DOMContentLoaded', () => { + mermaid.initialize(config); +}); diff --git a/config/_default/config.toml b/config/_default/config.toml index c87068f..d0cc42f 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -92,6 +92,3 @@ rel = "sitemap" [[module.mounts]] source = "node_modules/mermaid" target = "assets/js/vendor/mermaid" - [[module.mounts]] - source = "node_modules/mermaid" - target = "static/js/vendor/mermaid" diff --git a/content/docs/prologue/quick-start.md b/content/docs/prologue/quick-start.md index 817c5f7..05d8ca7 100644 --- a/content/docs/prologue/quick-start.md +++ b/content/docs/prologue/quick-start.md @@ -15,6 +15,16 @@ toc: true ## Flow +```md +{{}} +graph TD + A[Hard] -->|Text| B(Round) + B --> C{Decision} + C -->|One| D[Result 1] + C -->|Two| E[Result 2] +{{}} +``` + {{< mermaid class="bg-light text-center">}} graph TD A[Hard] -->|Text| B(Round) @@ -54,14 +64,21 @@ gantt {{< mermaid >}} classDiagram - classA --|> classB : Inheritance - classC --* classD : Composition - classE --o classF : Aggregation - classG --> classH : Association - classI -- classJ : Link(Solid) - classK ..> classL : Dependency - classM ..|> classN : Realization - classO .. classP : Link(Dashed) + Class01 <|-- AveryLongClass : Cool + <> Class01 + Class09 --> C2 : Where am i? + Class09 --* C3 + Class09 --|> Class07 + Class07 : equals() + Class07 : Object[] elementData + Class01 : size() + Class01 : int chimp + Class01 : int gorilla + class Class10 { + <> + int id + size() + } {{< /mermaid >}} ## State diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index d26624e..58bec09 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -1,3 +1,8 @@ -
- {{- .Inner -}} -
\ No newline at end of file +{{ if .Site.Params.options.mermaid -}} +
+ {{ $data := replaceRE "(^\\s+```)" "" .Inner -}} + {{ replaceRE "(```\\s+$)" "" $data -}} +
+{{ else }} + {{ errorf "Set `mermaid = true` in `./config/_default/params.toml`"}} +{{ end }} \ No newline at end of file From 6a87dc6e29d0675316ae912bc96a26ae7b368c1a Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Thu, 1 Jul 2021 08:48:56 +0200 Subject: [PATCH 04/12] feat: update script loading --- assets/js/mermaid.js | 2 ++ layouts/partials/footer/script-footer.html | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/assets/js/mermaid.js b/assets/js/mermaid.js index 7831e65..b8b2a82 100644 --- a/assets/js/mermaid.js +++ b/assets/js/mermaid.js @@ -1,3 +1,5 @@ +import mermaid from 'mermaid/dist/mermaid'; + var config = { theme: 'default', fontFamily: '"Jost", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";', diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html index 4238c15..c868c79 100644 --- a/layouts/partials/footer/script-footer.html +++ b/layouts/partials/footer/script-footer.html @@ -10,7 +10,7 @@ {{ $katex := resources.Get "js/vendor/katex/dist/katex.js" -}} {{ $katexAutoRender := resources.Get "js/vendor/katex/dist/contrib/auto-render.js" -}} -{{ $mermaid := resources.Get "js/vendor/mermaid/dist/mermaid.min.js" -}} +{{ $mermaid := resources.Get "js/mermaid.js" | js.Build -}} {{ $app := resources.Get "js/app.js" -}} @@ -51,12 +51,6 @@ {{ $slice = $slice | append $katexConfig -}} {{ end -}} -{{ if .Site.Params.options.mermaid -}} - {{ $mermaidConfig := resources.Get "js/mermaid.js" -}} - {{ $mermaidConfig := $mermaidConfig | js.Build -}} - {{ $slice = $slice | append $mermaidConfig -}} -{{ end -}} - {{ $js := $slice | resources.Concat "main.js" -}} {{ if eq (hugo.Environment) "development" -}} @@ -70,10 +64,10 @@ {{ end -}} + {{ if .Site.Params.options.mermaid -}} {{ end -}} - {{ if .Site.Params.options.flexSearch -}} {{ end -}} @@ -95,10 +89,10 @@ {{ end -}} + {{ if .Site.Params.options.mermaid -}} {{ end -}} - {{ if .Site.Params.options.flexSearch -}} {{ end -}} From 7d6df42519cabcc89115df95d32a3aa9b968e4a6 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Thu, 1 Jul 2021 16:21:03 +0200 Subject: [PATCH 05/12] feat: add mermaid code fences usage --- assets/js/clipboard.js | 6 ++- assets/js/mermaid.js | 1 + assets/scss/app.scss | 2 +- assets/scss/common/_dark.scss | 10 ++--- assets/scss/components/_code.scss | 4 ++ .../{_diagrams.scss => _mermaid.scss} | 0 content/docs/prologue/quick-start.md | 38 +++++++++++++++---- layouts/shortcodes/mermaid.html | 6 +-- 8 files changed, 50 insertions(+), 17 deletions(-) rename assets/scss/components/{_diagrams.scss => _mermaid.scss} (100%) diff --git a/assets/js/clipboard.js b/assets/js/clipboard.js index d8a95ef..55eec7b 100644 --- a/assets/js/clipboard.js +++ b/assets/js/clipboard.js @@ -5,7 +5,11 @@ var pre = document.getElementsByTagName('pre'); for (var i = 0; i < pre.length; ++ i) { var element = pre[i]; - element.insertAdjacentHTML('afterbegin', ''); + var mermaid = element.getElementsByClassName('language-mermaid')[0]; + + if (mermaid == null) { + element.insertAdjacentHTML('afterbegin', ''); + } } var clipboard = new Clipboard('.btn-copy', { diff --git a/assets/js/mermaid.js b/assets/js/mermaid.js index b8b2a82..2ab0b9a 100644 --- a/assets/js/mermaid.js +++ b/assets/js/mermaid.js @@ -7,4 +7,5 @@ var config = { document.addEventListener('DOMContentLoaded', () => { mermaid.initialize(config); + mermaid.init(undefined, '.language-mermaid'); }); diff --git a/assets/scss/app.scss b/assets/scss/app.scss index dea62e6..fc76d8e 100644 --- a/assets/scss/app.scss +++ b/assets/scss/app.scss @@ -22,9 +22,9 @@ @import "components/code"; @import "components/syntax"; @import "components/comments"; -@import "components/diagrams"; @import "components/forms"; @import "components/images"; +@import "components/mermaid"; @import "components/search"; @import "components/tables"; @import "layouts/footer"; diff --git a/assets/scss/common/_dark.scss b/assets/scss/common/_dark.scss index 44deb6c..7cafd9e 100644 --- a/assets/scss/common/_dark.scss +++ b/assets/scss/common/_dark.scss @@ -232,11 +232,6 @@ body.dark pre code::-webkit-scrollbar-thumb { background: $gray-400; } -body.dark code:not(.hljs) { - background: $body-overlay-dark; - color: $body-color-dark; -} - body.dark pre code:hover { scrollbar-width: thin; scrollbar-color: $border-dark transparent; @@ -246,6 +241,11 @@ body.dark pre code::-webkit-scrollbar-thumb:hover { background: $gray-500; } +body.dark code:not(.hljs):not(.language-mermaid) { + background: $body-overlay-dark; + color: $body-color-dark; +} + body.dark blockquote { border-left: 3px solid $border-dark; } diff --git a/assets/scss/components/_code.scss b/assets/scss/components/_code.scss index c53e6f7..eb0c0a0 100644 --- a/assets/scss/components/_code.scss +++ b/assets/scss/components/_code.scss @@ -60,3 +60,7 @@ pre code:hover { pre code::-webkit-scrollbar-thumb:hover { background: $gray-500; } + +code.language-mermaid { + background: none; +} diff --git a/assets/scss/components/_diagrams.scss b/assets/scss/components/_mermaid.scss similarity index 100% rename from assets/scss/components/_diagrams.scss rename to assets/scss/components/_mermaid.scss diff --git a/content/docs/prologue/quick-start.md b/content/docs/prologue/quick-start.md index 05d8ca7..74f27af 100644 --- a/content/docs/prologue/quick-start.md +++ b/content/docs/prologue/quick-start.md @@ -15,6 +15,8 @@ toc: true ## Flow +### Shortcode + ```md {{}} graph TD @@ -33,6 +35,26 @@ graph TD C -->|Two| E[Result 2] {{< /mermaid >}} +### Code fences + +````md +```mermaid +graph TD + A[Hard] -->|Text| B(Round) + B --> C{Decision} + C -->|One| D[Result 1] + C -->|Two| E[Result 2] +``` +```` + +```mermaid +graph TD + A[Hard] -->|Text| B(Round) + B --> C{Decision} + C -->|One| D[Result 1] + C -->|Two| E[Result 2] +``` + ## Sequence {{< mermaid >}} @@ -51,13 +73,15 @@ sequenceDiagram {{< mermaid >}} gantt - section Section - Completed :done, des1, 2014-01-06,2014-01-08 - Active :active, des2, 2014-01-07, 3d - Parallel 1 : des3, after des1, 1d - Parallel 2 : des4, after des1, 1d - Parallel 3 : des5, after des3, 1d - Parallel 4 : des6, after des4, 1d +dateFormat YYYY-MM-DD +title Adding GANTT diagram to mermaid +excludes weekdays 2014-01-10 + +section A section +Completed task :done, des1, 2014-01-06,2014-01-08 +Active task :active, des2, 2014-01-09, 3d +Future task : des3, after des2, 5d +Future task2 : des4, after des3, 5d {{< /mermaid >}} ## Class diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index 58bec09..ebba085 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -3,6 +3,6 @@ {{ $data := replaceRE "(^\\s+```)" "" .Inner -}} {{ replaceRE "(```\\s+$)" "" $data -}} -{{ else }} - {{ errorf "Set `mermaid = true` in `./config/_default/params.toml`"}} -{{ end }} \ No newline at end of file +{{ else -}} + {{ errorf "Set `mermaid = true` in `./config/_default/params.toml`" }} +{{ end -}} From fa2096da39555972875f1e2dec78316ba99b0176 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Thu, 1 Jul 2021 16:37:59 +0200 Subject: [PATCH 06/12] feat: update mermaid code fences usage --- assets/js/highlight.js | 2 +- content/docs/prologue/quick-start.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/js/highlight.js b/assets/js/highlight.js index 00a2a2d..c96b781 100644 --- a/assets/js/highlight.js +++ b/assets/js/highlight.js @@ -18,7 +18,7 @@ hljs.registerLanguage('yaml', yaml); hljs.registerLanguage('md', markdown); document.addEventListener('DOMContentLoaded', () => { - document.querySelectorAll('pre code').forEach((block) => { + document.querySelectorAll('pre code:not(.language-mermaid)').forEach((block) => { hljs.highlightElement(block); }); }); diff --git a/content/docs/prologue/quick-start.md b/content/docs/prologue/quick-start.md index 74f27af..bfe331b 100644 --- a/content/docs/prologue/quick-start.md +++ b/content/docs/prologue/quick-start.md @@ -13,6 +13,12 @@ weight: 110 toc: true --- +```js +function myFunction(p1, p2) { + return p1 * p2; // The function returns the product of p1 and p2 +} +``` + ## Flow ### Shortcode From 6e00bc86da2a2340b9c06893505675d817ce5bcc Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Fri, 2 Jul 2021 09:07:05 +0200 Subject: [PATCH 07/12] ux: update for dark mode --- assets/scss/common/_dark.scss | 5 ++ content/docs/prologue/quick-start.md | 83 +++++++++++++++++++--------- layouts/shortcodes/mermaid.html | 2 +- 3 files changed, 62 insertions(+), 28 deletions(-) diff --git a/assets/scss/common/_dark.scss b/assets/scss/common/_dark.scss index 7cafd9e..479dfc1 100644 --- a/assets/scss/common/_dark.scss +++ b/assets/scss/common/_dark.scss @@ -246,6 +246,11 @@ body.dark code:not(.hljs):not(.language-mermaid) { color: $body-color-dark; } +body.dark .mermaid, +body.dark pre code.language-mermaid { + background: $white; +} + body.dark blockquote { border-left: 3px solid $border-dark; } diff --git a/content/docs/prologue/quick-start.md b/content/docs/prologue/quick-start.md index bfe331b..70de019 100644 --- a/content/docs/prologue/quick-start.md +++ b/content/docs/prologue/quick-start.md @@ -19,7 +19,7 @@ function myFunction(p1, p2) { } ``` -## Flow +## Flowchart ### Shortcode @@ -61,7 +61,7 @@ graph TD C -->|Two| E[Result 2] ``` -## Sequence +## Sequence diagram {{< mermaid >}} sequenceDiagram @@ -75,22 +75,7 @@ sequenceDiagram Bob-->>John: Jolly good! {{< /mermaid >}} -## Gantt - -{{< mermaid >}} -gantt -dateFormat YYYY-MM-DD -title Adding GANTT diagram to mermaid -excludes weekdays 2014-01-10 - -section A section -Completed task :done, des1, 2014-01-06,2014-01-08 -Active task :active, des2, 2014-01-09, 3d -Future task : des3, after des2, 5d -Future task2 : des4, after des3, 5d -{{< /mermaid >}} - -## Class +## Class diagram {{< mermaid >}} classDiagram @@ -111,7 +96,7 @@ classDiagram } {{< /mermaid >}} -## State +## State diagram {{< mermaid >}} stateDiagram-v2 @@ -123,18 +108,16 @@ stateDiagram-v2 Crash --> [*] {{< /mermaid >}} -## Pie +## Entity Relationship Diagram {{< mermaid >}} -pie - title Key elements in Product X - "Calcium" : 42.96 - "Potassium" : 50.05 - "Magnesium" : 10.01 - "Iron" : 5 +erDiagram + CUSTOMER ||--o{ ORDER : places + ORDER ||--|{ LINE-ITEM : contains + CUSTOMER }|..|{ DELIVERY-ADDRESS : uses {{< /mermaid >}} -## User Journey +## User Journey Diagram {{< mermaid >}} journey @@ -148,6 +131,52 @@ journey Sit down: 3: Me {{< /mermaid >}} +## Gantt chart + +{{< mermaid >}} +gantt +dateFormat YYYY-MM-DD +title Adding GANTT diagram to mermaid +excludes weekdays 2014-01-10 + +section A section +Completed task :done, des1, 2014-01-06,2014-01-08 +Active task :active, des2, 2014-01-09, 3d +Future task : des3, after des2, 5d +Future task2 : des4, after des3, 5d +{{< /mermaid >}} + +## Pie chart + +{{< mermaid >}} +pie + title Key elements in Product X + "Calcium" : 42.96 + "Potassium" : 50.05 + "Magnesium" : 10.01 + "Iron" : 5 +{{< /mermaid >}} + +## Requirement Diagram + +```mermaid +requirementDiagram + + requirement test_req { + id: 1 + text: the test text. + risk: high + verifymethod: test + } + + element test_entity { + type: simulation + } + + test_entity - satisfies -> test_req + +``` + ## Requirements Doks uses npm to centralize dependency management, making it [easy to update]({{< relref "how-to-update" >}}) resources, build tooling, plugins, and build scripts: diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index ebba085..ae18745 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -4,5 +4,5 @@ {{ replaceRE "(```\\s+$)" "" $data -}} {{ else -}} - {{ errorf "Set `mermaid = true` in `./config/_default/params.toml`" }} + {{ errorf "Failed to process mermaid shortcode(s). Set `mermaid = true` in `./config/_default/params.toml`." }} {{ end -}} From 701a4b81d13f0d12a809dc0cde47683b54e555f1 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Fri, 2 Jul 2021 11:08:31 +0200 Subject: [PATCH 08/12] perf: optimize mermaid script loading --- config/_default/params.toml | 1 - content/docs/prologue/quick-start.md | 7 +------ layouts/partials/footer/script-footer.html | 4 ++-- layouts/shortcodes/mermaid.html | 4 ++-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/config/_default/params.toml b/config/_default/params.toml index c571bf4..9601055 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -72,4 +72,3 @@ editPage = false highLight = true kaTex = false collapsibleSidebar = false - mermaid = true diff --git a/content/docs/prologue/quick-start.md b/content/docs/prologue/quick-start.md index 70de019..c95f282 100644 --- a/content/docs/prologue/quick-start.md +++ b/content/docs/prologue/quick-start.md @@ -11,14 +11,9 @@ menu: parent: "prologue" weight: 110 toc: true +mermaid: true --- -```js -function myFunction(p1, p2) { - return p1 * p2; // The function returns the product of p1 and p2 -} -``` - ## Flowchart ### Shortcode diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html index c868c79..64ccf13 100644 --- a/layouts/partials/footer/script-footer.html +++ b/layouts/partials/footer/script-footer.html @@ -65,7 +65,7 @@ {{ end -}} - {{ if .Site.Params.options.mermaid -}} + {{ with .Params.mermaid -}} {{ end -}} {{ if .Site.Params.options.flexSearch -}} @@ -90,7 +90,7 @@ {{ end -}} - {{ if .Site.Params.options.mermaid -}} + {{ with .Params.mermaid -}} {{ end -}} {{ if .Site.Params.options.flexSearch -}} diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index ae18745..aeecad5 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -1,8 +1,8 @@ -{{ if .Site.Params.options.mermaid -}} +{{ if .Page.Params.mermaid -}}
{{ $data := replaceRE "(^\\s+```)" "" .Inner -}} {{ replaceRE "(```\\s+$)" "" $data -}}
{{ else -}} - {{ errorf "Failed to process mermaid shortcode(s). Set `mermaid = true` in `./config/_default/params.toml`." }} + {{ errorf "Failed to process mermaid shortcode: %s. Set mermaid to true in page front matter." .Position }} {{ end -}} From e4fc8681623685bf20f8e6568a69b5b6c4d81d16 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Fri, 2 Jul 2021 13:51:57 +0200 Subject: [PATCH 09/12] content: remove temporary mermaid examples --- content/docs/prologue/quick-start.md | 159 --------------------------- 1 file changed, 159 deletions(-) diff --git a/content/docs/prologue/quick-start.md b/content/docs/prologue/quick-start.md index c95f282..9282d3e 100644 --- a/content/docs/prologue/quick-start.md +++ b/content/docs/prologue/quick-start.md @@ -11,167 +11,8 @@ menu: parent: "prologue" weight: 110 toc: true -mermaid: true --- -## Flowchart - -### Shortcode - -```md -{{}} -graph TD - A[Hard] -->|Text| B(Round) - B --> C{Decision} - C -->|One| D[Result 1] - C -->|Two| E[Result 2] -{{}} -``` - -{{< mermaid class="bg-light text-center">}} -graph TD - A[Hard] -->|Text| B(Round) - B --> C{Decision} - C -->|One| D[Result 1] - C -->|Two| E[Result 2] -{{< /mermaid >}} - -### Code fences - -````md -```mermaid -graph TD - A[Hard] -->|Text| B(Round) - B --> C{Decision} - C -->|One| D[Result 1] - C -->|Two| E[Result 2] -``` -```` - -```mermaid -graph TD - A[Hard] -->|Text| B(Round) - B --> C{Decision} - C -->|One| D[Result 1] - C -->|Two| E[Result 2] -``` - -## Sequence diagram - -{{< mermaid >}} -sequenceDiagram - Alice->>John: Hello John, how are you? - loop Healthcheck - John->>John: Fight against hypochondria - end - Note right of John: Rational thoughts! - John-->>Alice: Great! - John->>Bob: How about you? - Bob-->>John: Jolly good! -{{< /mermaid >}} - -## Class diagram - -{{< mermaid >}} -classDiagram - Class01 <|-- AveryLongClass : Cool - <> Class01 - Class09 --> C2 : Where am i? - Class09 --* C3 - Class09 --|> Class07 - Class07 : equals() - Class07 : Object[] elementData - Class01 : size() - Class01 : int chimp - Class01 : int gorilla - class Class10 { - <> - int id - size() - } -{{< /mermaid >}} - -## State diagram - -{{< mermaid >}} -stateDiagram-v2 - [*] --> Still - Still --> [*] - Still --> Moving - Moving --> Still - Moving --> Crash - Crash --> [*] -{{< /mermaid >}} - -## Entity Relationship Diagram - -{{< mermaid >}} -erDiagram - CUSTOMER ||--o{ ORDER : places - ORDER ||--|{ LINE-ITEM : contains - CUSTOMER }|..|{ DELIVERY-ADDRESS : uses -{{< /mermaid >}} - -## User Journey Diagram - -{{< mermaid >}} -journey - title My working day - section Go to work - Make tea: 5: Me - Go upstairs: 3: Me - Do work: 1: Me, Cat - section Go home - Go downstairs: 5: Me - Sit down: 3: Me -{{< /mermaid >}} - -## Gantt chart - -{{< mermaid >}} -gantt -dateFormat YYYY-MM-DD -title Adding GANTT diagram to mermaid -excludes weekdays 2014-01-10 - -section A section -Completed task :done, des1, 2014-01-06,2014-01-08 -Active task :active, des2, 2014-01-09, 3d -Future task : des3, after des2, 5d -Future task2 : des4, after des3, 5d -{{< /mermaid >}} - -## Pie chart - -{{< mermaid >}} -pie - title Key elements in Product X - "Calcium" : 42.96 - "Potassium" : 50.05 - "Magnesium" : 10.01 - "Iron" : 5 -{{< /mermaid >}} - -## Requirement Diagram - -```mermaid -requirementDiagram - - requirement test_req { - id: 1 - text: the test text. - risk: high - verifymethod: test - } - - element test_entity { - type: simulation - } - - test_entity - satisfies -> test_req - -``` - ## Requirements Doks uses npm to centralize dependency management, making it [easy to update]({{< relref "how-to-update" >}}) resources, build tooling, plugins, and build scripts: From 3dba35098a8ec82a0a8635a45baf7272a90b0b16 Mon Sep 17 00:00:00 2001 From: sharjeelaziz Date: Sun, 4 Jul 2021 20:36:06 -0400 Subject: [PATCH 10/12] Fix lint tests on Linux. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 404f11e..8615131 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "lint": "npm run -s lint:scripts && npm run -s lint:styles && npm run -s lint:markdown", "lint:scripts": "eslint assets/js config functions", "lint:styles": "stylelint \"assets/scss/**/*.{css,sass,scss,sss,less}\"", - "lint:markdown": "markdownlint *.md content/**/*.md", + "lint:markdown": "markdownlint \"*.md\" \"content/**/*.md\"", "server": "exec-bin bin/hugo/hugo server", "test": "npm run -s lint", "env": "env", From 379768538d584676d40c99432f8b49f20c2c0562 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Mon, 5 Jul 2021 09:42:16 +0200 Subject: [PATCH 11/12] fix: update package-lock.json --- package-lock.json | 147 +++++++++++++++++++++++++++++----------------- 1 file changed, 93 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index c46a6bc..20a464e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1653,6 +1653,26 @@ "postcss": "^8.0.0" } }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, "node_modules/@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.2", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.2.tgz", @@ -1813,9 +1833,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "15.12.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.5.tgz", - "integrity": "sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.0.0.tgz", + "integrity": "sha512-TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSdg==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -1840,9 +1860,9 @@ } }, "node_modules/@types/unist": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", - "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.4.tgz", + "integrity": "sha512-zfyYsDTK1HTGYXU3fTiM76+om93HcFtsZd2M0bO/CL4DiETV7mSa/pIVN/6+G3esOqEMdg2An5cHHbK5t+9w+A==", "dev": true }, "node_modules/acorn": { @@ -2499,9 +2519,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001241", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001241.tgz", - "integrity": "sha512-1uoSZ1Pq1VpH0WerIMqwptXHNNGfdl7d1cJUFs80CwQ/lVzdhTvsFZCeNFslze7AjsQnb4C85tzclPa1VShbeQ==", + "version": "1.0.30001242", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001242.tgz", + "integrity": "sha512-KvNuZ/duufelMB3w2xtf9gEWCSxJwUgoxOx5b6ScLXC4kPc9xsczUVCPrQU26j5kOsHM4pSUL54tAZt5THQKug==", "dev": true, "funding": { "type": "opencollective", @@ -3279,9 +3299,9 @@ } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -3648,9 +3668,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.3.762", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.762.tgz", - "integrity": "sha512-LehWjRpfPcK8F1Lf/NZoAwWLWnjJVo0SZeQ9j/tvnBWYcT99qDqgo4raAfS2oTKZjPrR/jxruh85DGgDUmywEA==", + "version": "1.3.766", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.766.tgz", + "integrity": "sha512-u2quJ862q9reRKh/je3GXis3w38+RoXH1J9N3XjtsS6NzmUAosNsyZgUVFZPN/ZlJ3v6T0rTyZR3q/J5c6Sy5w==", "dev": true }, "node_modules/emoji-regex": { @@ -3726,13 +3746,14 @@ } }, "node_modules/eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", + "version": "7.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", + "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", "dev": true, "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.2", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -4328,9 +4349,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", + "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -4409,9 +4430,9 @@ } }, "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.0.tgz", + "integrity": "sha512-XprP7lDrVT+kE2c2YlfiV+IfS9zxukiIOvNamPNsImNhXadSsQEbosItdL9bUQlCZXR13SvPk20BjWSWLA7m4A==", "dev": true }, "node_modules/flexsearch": { @@ -9177,9 +9198,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.1.tgz", + "integrity": "sha512-42VLtQUOLefAvKFAQIxIZDaThq6om/PrfP0CYk3/vn+y4BMNkKnbli8ON2QCiHov4KkzOSJ/xSoBJdayiiYvVQ==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -11025,6 +11046,23 @@ "purgecss": "^4.0.3" } }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, "@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.2", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.2.tgz", @@ -11155,9 +11193,9 @@ "dev": true }, "@types/node": { - "version": "15.12.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.5.tgz", - "integrity": "sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.0.0.tgz", + "integrity": "sha512-TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSdg==", "dev": true }, "@types/normalize-package-data": { @@ -11182,9 +11220,9 @@ } }, "@types/unist": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", - "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.4.tgz", + "integrity": "sha512-zfyYsDTK1HTGYXU3fTiM76+om93HcFtsZd2M0bO/CL4DiETV7mSa/pIVN/6+G3esOqEMdg2An5cHHbK5t+9w+A==", "dev": true }, "acorn": { @@ -11664,9 +11702,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001241", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001241.tgz", - "integrity": "sha512-1uoSZ1Pq1VpH0WerIMqwptXHNNGfdl7d1cJUFs80CwQ/lVzdhTvsFZCeNFslze7AjsQnb4C85tzclPa1VShbeQ==", + "version": "1.0.30001242", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001242.tgz", + "integrity": "sha512-KvNuZ/duufelMB3w2xtf9gEWCSxJwUgoxOx5b6ScLXC4kPc9xsczUVCPrQU26j5kOsHM4pSUL54tAZt5THQKug==", "dev": true }, "chalk": { @@ -12343,9 +12381,9 @@ } }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { "ms": "2.1.2" @@ -12633,9 +12671,9 @@ } }, "electron-to-chromium": { - "version": "1.3.762", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.762.tgz", - "integrity": "sha512-LehWjRpfPcK8F1Lf/NZoAwWLWnjJVo0SZeQ9j/tvnBWYcT99qDqgo4raAfS2oTKZjPrR/jxruh85DGgDUmywEA==", + "version": "1.3.766", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.766.tgz", + "integrity": "sha512-u2quJ862q9reRKh/je3GXis3w38+RoXH1J9N3XjtsS6NzmUAosNsyZgUVFZPN/ZlJ3v6T0rTyZR3q/J5c6Sy5w==", "dev": true }, "emoji-regex": { @@ -12699,13 +12737,14 @@ "dev": true }, "eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", + "version": "7.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", + "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.2", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -13168,9 +13207,9 @@ "dev": true }, "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", + "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -13234,9 +13273,9 @@ } }, "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.0.tgz", + "integrity": "sha512-XprP7lDrVT+kE2c2YlfiV+IfS9zxukiIOvNamPNsImNhXadSsQEbosItdL9bUQlCZXR13SvPk20BjWSWLA7m4A==", "dev": true }, "flexsearch": { @@ -16921,9 +16960,9 @@ }, "dependencies": { "ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.1.tgz", + "integrity": "sha512-42VLtQUOLefAvKFAQIxIZDaThq6om/PrfP0CYk3/vn+y4BMNkKnbli8ON2QCiHov4KkzOSJ/xSoBJdayiiYvVQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", From 43c2d3f11539c33b7624ae4e09ca02ab4588f8c9 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Mon, 5 Jul 2021 09:51:09 +0200 Subject: [PATCH 12/12] fix: update for netlify checks --- config/_default/config.toml | 4 ++++ netlify.toml | 11 ++++++----- package.json | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/config/_default/config.toml b/config/_default/config.toml index d0cc42f..56fc5c8 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -77,6 +77,10 @@ rel = "sitemap" blog = "/blog/:title/" [module] + [module.hugoVersion] + extended = true + min = "0.80.0" + max = "" [[module.mounts]] source = "assets" target = "assets" diff --git a/netlify.toml b/netlify.toml index cebb46a..3513a54 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,25 +5,26 @@ [build.environment] NODE_VERSION = "16.3.0" NPM_VERSION = "7.16.0" + HUGO_VERSION = "0.84.4" [context.production] - command = "exec-bin bin/hugo/hugo --gc --minify" + command = "hugo --gc --minify" [context.deploy-preview] - command = "exec-bin bin/hugo/hugo --gc --minify -b $DEPLOY_PRIME_URL" + command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy] - command = "exec-bin bin/hugo/hugo --gc --minify -b $DEPLOY_PRIME_URL" + command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.next] - command = "exec-bin bin/hugo/hugo --gc --minify" + command = "hugo --gc --minify" [context.next.environment] HUGO_ENV = "next" [dev] framework = "#custom" - command = "shx rm -rf public resources && exec-bin bin/hugo/hugo server --bind=0.0.0.0 --disableFastRender" + command = "shx rm -rf public resources && hugo server --bind=0.0.0.0 --disableFastRender" targetPort = 1313 port = 8888 publish = "public" diff --git a/package.json b/package.json index 765f9ff..4070608 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "lint": "npm run -s lint:scripts && npm run -s lint:styles && npm run -s lint:markdown", "lint:scripts": "eslint assets/js config functions", "lint:styles": "stylelint \"assets/scss/**/*.{css,sass,scss,sss,less}\"", - "lint:markdown": "markdownlint *.md content/**/*.md", + "lint:markdown": "markdownlint \"*.md\" \"content/**/*.md\"", "server": "exec-bin bin/hugo/hugo server", "test": "npm run -s lint", "env": "env", @@ -60,6 +60,6 @@ "stylelint-config-standard": "^22.0" }, "otherDependencies": { - "hugo": "0.84.0" + "hugo": "0.84.4" } }