diff --git a/.gitignore b/.gitignore index 817eebf7a..d9c77c745 100644 --- a/.gitignore +++ b/.gitignore @@ -42,8 +42,8 @@ bld/ # Visual Studio 2015/2017 cache/options directory .vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ +# Pagefind.Net.Frontend auto-extraction output (disabled via PagefindFrontendDisableExtract) +wwwroot/ # Visual Studio 2017 auto generated files Generated\ Files/ diff --git a/Directory.Build.props b/Directory.Build.props index 3f89a0761..1e2d4f14b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -23,6 +23,7 @@ enable enable true + true diff --git a/Directory.Packages.props b/Directory.Packages.props index be5918099..0d0a5b39d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -45,6 +45,8 @@ + + diff --git a/NOTICE.txt b/NOTICE.txt index 9547245cf..0a230b023 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -26,6 +26,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +License notice for Pagefind (v1.5.2) +----------------------------------- +Copyright 2022 Pagefind + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + License notice for Errata (v0.13.0) ------------------------------------ MIT License diff --git a/docs/configure/content-set/index.md b/docs/configure/content-set/index.md index a8fea4a31..a1e7e933c 100644 --- a/docs/configure/content-set/index.md +++ b/docs/configure/content-set/index.md @@ -13,6 +13,18 @@ A content set in `docs-builder` is equivalent to an AsciiDoc book. At this level | **Content source files** --> A whole bunch of markup files as well as any other assets used in the docs (for example, images, videos, and diagrams). | **Markup**: AsciiDoc files **Assets**: Images, videos, and diagrams | **Markup**: MD files **Assets**: Images, videos, and diagrams | | **Information architecture** --> A way to specify the order in which these text-based files should appear in the information architecture of the book. | `index.asciidoc` file (this can be spread across several AsciiDoc files, but generally starts with the index file specified in the `conf.yaml` file)) | `docset.yml` and/or `toc.yml` file(s) | +## Static search + +Isolated builds and `docs-builder serve` automatically include a [Pagefind](https://pagefind.app) search index that runs entirely in the browser. No configuration is needed — the `pagefind` exporter is included by default. + +To use it with a static build, serve the output over HTTP: + +```sh +python3 -m http.server --directory .artifacts/docs/html +``` + +Static search does not require a search API. It does not work when pages are opened directly with `file://`. + ## Learn more * [File structure](./file-structure.md). diff --git a/src/Elastic.Codex/CodexGenerator.cs b/src/Elastic.Codex/CodexGenerator.cs index 3e8126fe7..a6b9948e2 100644 --- a/src/Elastic.Codex/CodexGenerator.cs +++ b/src/Elastic.Codex/CodexGenerator.cs @@ -72,11 +72,9 @@ private async Task ExtractEmbeddedStaticResources(Cancel ctx) { _logger.LogInformation("Copying static files to codex output directory"); var assembly = typeof(EmbeddedOrPhysicalFileProvider).Assembly; - var embeddedStaticFiles = assembly - .GetManifestResourceNames() - .ToList(); - foreach (var resourceName in embeddedStaticFiles) + foreach (var resourceName in assembly.GetManifestResourceNames() + .Where(r => r.StartsWith("Elastic.Documentation.Site._static.", StringComparison.Ordinal))) { await using var resourceStream = assembly.GetManifestResourceStream(resourceName); if (resourceStream == null) diff --git a/src/Elastic.Documentation.Site/Assets/web-components/Header/DeploymentInfo.tsx b/src/Elastic.Documentation.Site/Assets/web-components/Header/DeploymentInfo.tsx index 73a381ee0..3884c433d 100644 --- a/src/Elastic.Documentation.Site/Assets/web-components/Header/DeploymentInfo.tsx +++ b/src/Elastic.Documentation.Site/Assets/web-components/Header/DeploymentInfo.tsx @@ -72,9 +72,14 @@ export const DeploymentInfo = ({