diff --git a/README.md b/README.md index 7fbc1f981..0e6d0318f 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,11 @@ Additionally the following `markdown-it` plugins have been added: Please note: The closing `:::` is required. Also if you need to nest containers then the outer container gets an additional `:`. Each container type needs to be configured in `markdown-it-config.js` for examples and to add more. This one provides a lot of flexibility. +## Site search and indexing +The site uses the [Pagefind](https://pagefind.app/) library to index the contents of the site and to find search results upon request. +The documentation is quite good. One thing to note; pages are indexed based on the inclusion of the `data-pagefind-body` +attribute on a page. It is included on all of the main pages (all but the Design System). If you need to remove some or all of a page +from indexing you can use the `data-pagefind-ignore` attribute. See (https://pagefind.app/docs/indexing/) for details. ## Setup for Dev - `npm install` diff --git a/package-lock.json b/package-lock.json index 0389f4efb..78edad2f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "GPL-3.0-or-later", "dependencies": { - "pagefind": "^0.12.0" + "pagefind": "1.0.4" }, "devDependencies": { "@11ty/eleventy": "^2.0.0", @@ -247,6 +247,66 @@ "node": ">= 8" } }, + "node_modules/@pagefind/darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.0.4.tgz", + "integrity": "sha512-2OcthvceX2xhm5XbgOmW+lT45oLuHqCmvFeFtxh1gsuP5cO8vcD8ZH8Laj4pXQFCcK6eAdSShx+Ztx/LsQWZFQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.0.4.tgz", + "integrity": "sha512-xkdvp0D9Ld/ZKsjo/y1bgfhTEU72ITimd2PMMQtts7jf6JPIOJbsiErCvm37m/qMFuPGEq/8d+fZ4pydOj08HQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.0.4.tgz", + "integrity": "sha512-jGBrcCzIrMnNxLKVtogaQyajVfTAXM59KlBEwg6vTn8NW4fQ6nuFbbhlG4dTIsaamjEM5e8ZBEAKZfTB/qd9xw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.0.4.tgz", + "integrity": "sha512-LIn/QcvcEtLEBqKe5vpSbSC2O3fvqbRCWOTIklslqSORisCsvzsWbP6j+LYxE9q0oWIfkdMoWV1vrE/oCKRxHg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/windows-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.0.4.tgz", + "integrity": "sha512-QlBCVeZfj9fc9sbUgdOz76ZDbeK4xZihOBAFqGuRJeChfM8pnVeH9iqSnXgO3+m9oITugTf7PicyRUFAG76xeQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@selderee/plugin-htmlparser2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.6.0.tgz", @@ -362,17 +422,6 @@ "node": ">=0.4.0" } }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1038,6 +1087,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -1928,18 +1978,6 @@ "node": ">= 0.10" } }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -2734,7 +2772,8 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/multimatch": { "version": "5.0.0", @@ -3165,16 +3204,18 @@ } }, "node_modules/pagefind": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-0.12.0.tgz", - "integrity": "sha512-LHUmlYYweBM6/rK1G+7z2q2WjYeycrB7g5Kuw0w6yMkYztzsEdO2Qj2pJ3z8gsWV8eJsYQyAGOAdqE3SZWlCqA==", - "hasInstallScript": true, - "dependencies": { - "https-proxy-agent": "^5.0.0", - "proxy-from-env": "^1.1.0" - }, + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.0.4.tgz", + "integrity": "sha512-oRIizYe+zSI2Jw4zcMU0ebDZm27751hRFiSOBLwc1OIYMrsZKk+3m8p9EVaOmc6zZdtqwwdilNUNxXvBeHcP9w==", "bin": { - "pagefind": "lib/index.js" + "pagefind": "lib/runner/bin.cjs" + }, + "optionalDependencies": { + "@pagefind/darwin-arm64": "1.0.4", + "@pagefind/darwin-x64": "1.0.4", + "@pagefind/linux-arm64": "1.0.4", + "@pagefind/linux-x64": "1.0.4", + "@pagefind/windows-x64": "1.0.4" } }, "node_modules/param-case": { @@ -4072,11 +4113,6 @@ "any-promise": "^0.1.0" } }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, "node_modules/prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -5316,6 +5352,36 @@ "fastq": "^1.6.0" } }, + "@pagefind/darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.0.4.tgz", + "integrity": "sha512-2OcthvceX2xhm5XbgOmW+lT45oLuHqCmvFeFtxh1gsuP5cO8vcD8ZH8Laj4pXQFCcK6eAdSShx+Ztx/LsQWZFQ==", + "optional": true + }, + "@pagefind/darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.0.4.tgz", + "integrity": "sha512-xkdvp0D9Ld/ZKsjo/y1bgfhTEU72ITimd2PMMQtts7jf6JPIOJbsiErCvm37m/qMFuPGEq/8d+fZ4pydOj08HQ==", + "optional": true + }, + "@pagefind/linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.0.4.tgz", + "integrity": "sha512-jGBrcCzIrMnNxLKVtogaQyajVfTAXM59KlBEwg6vTn8NW4fQ6nuFbbhlG4dTIsaamjEM5e8ZBEAKZfTB/qd9xw==", + "optional": true + }, + "@pagefind/linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.0.4.tgz", + "integrity": "sha512-LIn/QcvcEtLEBqKe5vpSbSC2O3fvqbRCWOTIklslqSORisCsvzsWbP6j+LYxE9q0oWIfkdMoWV1vrE/oCKRxHg==", + "optional": true + }, + "@pagefind/windows-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.0.4.tgz", + "integrity": "sha512-QlBCVeZfj9fc9sbUgdOz76ZDbeK4xZihOBAFqGuRJeChfM8pnVeH9iqSnXgO3+m9oITugTf7PicyRUFAG76xeQ==", + "optional": true + }, "@selderee/plugin-htmlparser2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.6.0.tgz", @@ -5406,14 +5472,6 @@ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - } - }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -5891,6 +5949,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "requires": { "ms": "2.1.2" } @@ -6540,15 +6599,6 @@ "integrity": "sha512-TScO04soylRN9i/QdOdgZyhydXg9z6XdaGzEyOgDKycePeDeTT4KvigjBcI+tgfTlieLWauGORMq5F1eIDa+1w==", "dev": true }, - "https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "requires": { - "agent-base": "6", - "debug": "4" - } - }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -7148,7 +7198,8 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "multimatch": { "version": "5.0.0", @@ -7463,12 +7514,15 @@ } }, "pagefind": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-0.12.0.tgz", - "integrity": "sha512-LHUmlYYweBM6/rK1G+7z2q2WjYeycrB7g5Kuw0w6yMkYztzsEdO2Qj2pJ3z8gsWV8eJsYQyAGOAdqE3SZWlCqA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.0.4.tgz", + "integrity": "sha512-oRIizYe+zSI2Jw4zcMU0ebDZm27751hRFiSOBLwc1OIYMrsZKk+3m8p9EVaOmc6zZdtqwwdilNUNxXvBeHcP9w==", "requires": { - "https-proxy-agent": "^5.0.0", - "proxy-from-env": "^1.1.0" + "@pagefind/darwin-arm64": "1.0.4", + "@pagefind/darwin-x64": "1.0.4", + "@pagefind/linux-arm64": "1.0.4", + "@pagefind/linux-x64": "1.0.4", + "@pagefind/windows-x64": "1.0.4" } }, "param-case": { @@ -8089,11 +8143,6 @@ "any-promise": "^0.1.0" } }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", diff --git a/package.json b/package.json index aa73962c3..3533c9a59 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "doc": "docs" }, "scripts": { - "build:search-index": "npx pagefind --source _site --glob \"**/*.html\"", + "build:search-index": "npx pagefind --site _site --glob \"**/*.html\"", "build:web": "ELEVENTY_ENV=production npx @11ty/eleventy", "serve:web": "ELEVENTY_ENV=development npx @11ty/eleventy --serve --incremental", "serve:web-prod": "ELEVENTY_ENV=production BROWERSYNC=off npx @11ty/eleventy --serve", @@ -72,6 +72,6 @@ "uglify-js": "^3.17.4" }, "dependencies": { - "pagefind": "^0.12.0" + "pagefind": "1.0.4" } } diff --git a/src/client-side/page-search.ts b/src/client-side/page-search.ts index eaa071f24..458f06705 100644 --- a/src/client-side/page-search.ts +++ b/src/client-side/page-search.ts @@ -18,7 +18,8 @@ const PagefindSearchKey = "pagefind-search"; function setupPagefindUI() { const pagefindUIInstance = new PagefindUI({ element: "#search", - showImages: false + showImages: false, + showSubResults: true }); const searchInput = window.document.querySelector("#search .pagefind-ui__search-input")!; diff --git a/src/pages/_includes/base-layout.njk b/src/pages/_includes/base-layout.njk index d15f03ff0..1f8681f9f 100644 --- a/src/pages/_includes/base-layout.njk +++ b/src/pages/_includes/base-layout.njk @@ -2,7 +2,7 @@ {% include "parts/head.njk" %} - + {% include "parts/header.njk" %} {% renderlayoutblock "abovePageWrap" %}{% endrenderlayoutblock %} diff --git a/src/pages/search.njk b/src/pages/search.njk index 9f4c21973..f4eb1c86e 100644 --- a/src/pages/search.njk +++ b/src/pages/search.njk @@ -4,8 +4,8 @@ layout: default-page-layout.njk pageStyleId: search --- - - + + \ No newline at end of file