From a0af7cc696da987a76edab96cdd2329779e87724 Mon Sep 17 00:00:00 2001 From: Kevin Zuniga Cuellar Date: Mon, 29 Jan 2024 06:07:30 -0500 Subject: extend config options to pagefind (#1365) Co-authored-by: Chris Swithinbank --- .changeset/silver-dots-guess.md | 5 +++++ package.json | 2 +- packages/starlight/components/Search.astro | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .changeset/silver-dots-guess.md diff --git a/.changeset/silver-dots-guess.md b/.changeset/silver-dots-guess.md new file mode 100644 index 00000000..f5ea3506 --- /dev/null +++ b/.changeset/silver-dots-guess.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Correctly format Pagefind search result links when `trailingSlash: 'never'` is used diff --git a/package.json b/package.json index 1d7e1870..40eee078 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ { "name": "/_astro/*.js", "path": "examples/basics/dist/_astro/*.js", - "limit": "22 kB" + "limit": "22.5 kB" }, { "name": "/_astro/*.css", diff --git a/packages/starlight/components/Search.astro b/packages/starlight/components/Search.astro index 2b5f3ac4..ec53fc3e 100644 --- a/packages/starlight/components/Search.astro +++ b/packages/starlight/components/Search.astro @@ -1,6 +1,7 @@ --- import '@pagefind/default-ui/css/ui.css'; import Icon from '../user-components/Icon.astro'; +import project from 'virtual:starlight/project-context'; import type { Props } from '../props'; const { labels } = Astro.props; @@ -15,7 +16,10 @@ const pagefindTranslations = { }; --- - +