Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
868e23e
feat: new pagefind ui
HiDeoo Jul 23, 2025
4b53712
feat: use `aria-atomic` on live region
HiDeoo Jul 30, 2025
d6a3b52
feat: stop auto-selecting first result
HiDeoo Jul 30, 2025
adb40da
feat: add listbox label
HiDeoo Jul 30, 2025
ea8435e
feat: list `aria-autocomplete`
HiDeoo Jul 30, 2025
46dc2ec
feat: always visible input
HiDeoo Jul 30, 2025
6d2ac60
feat: `triggerFilters` public api
HiDeoo Aug 13, 2025
1833a66
feat: `triggerSearch` public api
HiDeoo Aug 13, 2025
41c20ba
feat: `showEmptyFilters` option
HiDeoo Aug 13, 2025
f573972
feat: `openFilters` option
HiDeoo Aug 13, 2025
2d2d94a
feat: `clientOptionsModule` and `processTerm` options
HiDeoo Aug 13, 2025
b37e884
chore: remove comment
HiDeoo Aug 13, 2025
5df04a7
chore: add comment about home/end keys
HiDeoo Aug 20, 2025
4ac0dd5
feat: add sticky footer
HiDeoo Aug 20, 2025
76c70cf
refactor: pagefind api
HiDeoo Aug 20, 2025
b9efba7
Merge branch 'main' into hd-feat-new-pagefind-ui
HiDeoo Aug 27, 2025
6bdfeac
chore: add missing translations
HiDeoo Aug 27, 2025
b22b74f
fix: linting
HiDeoo Aug 27, 2025
2871b87
chore: remove filters and metas
HiDeoo Aug 27, 2025
641e246
test: update coverage config
HiDeoo Aug 27, 2025
d89cee6
Merge branch 'main' into hd-feat-new-pagefind-ui
HiDeoo Oct 1, 2025
fe622bb
fix: remove nested landmarks
HiDeoo Oct 2, 2025
703307e
fix: scrollable region keyboard access
HiDeoo Oct 2, 2025
99c8aa2
Merge branch 'main' into pr/3335
delucis Apr 3, 2026
0cd1922
Fix `processTerm` schema for Zod 4
delucis Apr 3, 2026
e551012
Update missing keys in new locales
delucis Apr 3, 2026
eb9f834
Update dictionaries to use translations where available
delucis Apr 3, 2026
9635fc2
Tell Vite not to worry about the unresolvable Pagefind import
delucis Apr 3, 2026
a0ad9f3
Assert type of dictionary contents in Search component
delucis Apr 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default defineConfig({
trailingSlash: 'always',
integrations: [
starlight({
// TODO(HiDeoo) Remove the overrides and associated files.
components: {
Search: './src/components/SearchOverride.astro',
},
title: 'Starlight',
logo: {
light: '/src/assets/logo-light.svg',
Expand Down Expand Up @@ -70,6 +74,11 @@ export default defineConfig({
customCss: ['./src/assets/landing.css'],
locales,
sidebar: [
// TODO(HiDeoo) Remove this autogenerated group.
{
label: 'Demo',
autogenerate: { directory: 'demo' },
},
{
label: 'Start Here',
translations: {
Expand Down
4 changes: 4 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"scripts": {
"test": "playwright install --with-deps chromium && playwright test",
"dev": "astro dev",
"comment": "// TODO(HiDeoo) Remove these pagefind related scripts",
"pagefind": "pnpm run --stream /^pagefind:/",
"pagefind:build": "astro build && astro preview",
"pagefind:dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/assets/landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
60rem 30rem;
}

[data-has-hero] header {
[data-has-hero] .page > header {
border-bottom: 1px solid transparent;
background-color: transparent;
-webkit-backdrop-filter: blur(16px);
Expand Down
64 changes: 64 additions & 0 deletions docs/src/components/SearchOverride.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
import Default from '@astrojs/starlight/components/Search.astro';

// TODO(HiDeoo) Delete this override.

const { id } = Astro.locals.starlightRoute;

const triggerType =
id === 'demo/trigger-filters' ? 'filters' : id === 'demo/trigger-search' ? 'search' : undefined;
---

{
triggerType ? (
<custom-site-search data-trigger-type={triggerType}>
<Default>
<slot />
</Default>
</custom-site-search>
) : (
<Default>
<slot />
</Default>
)
}

<script>
customElements.define(
'custom-site-search',
class CustomSiteSearch extends HTMLElement {
constructor() {
super();

const triggerType = this.dataset.triggerType;
if (!triggerType) return;

this.#applyTrigger(triggerType);
}

async #applyTrigger(triggerType: string) {
const { getPagefindApi } = await import('@astrojs/starlight/pagefind');
const starlightPagefindApi = await getPagefindApi();

switch (triggerType) {
case 'filters': {
starlightPagefindApi.triggerFilters({
author: ['Alice'],
});
break;
}
case 'search': {
starlightPagefindApi.triggerSearch('test');
break;
}
}
}
}
);
</script>

<style>
custom-site-search {
display: contents;
}
</style>
11 changes: 11 additions & 0 deletions docs/src/content/docs/demo/trigger-filters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Trigger Filters API
---

:::danger
// TODO(HiDeoo) Delete this page.
:::

This page exists to test a public API for triggering filters in the Pagefind search component.

When doing a search from this page, e.g. for the word `test`, search results should be filtered by default to only include results that have the filter `author` set to `Alice`.
11 changes: 11 additions & 0 deletions docs/src/content/docs/demo/trigger-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Trigger Search API
---

:::danger
// TODO(HiDeoo) Delete this page.
:::

This page exists to test a public API for searching with the Pagefind search component.

When opening the search modal from this page, a search for the word `test` should be performed by default.
18 changes: 0 additions & 18 deletions docs/src/content/docs/guides/i18n.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,24 +232,6 @@ You can provide translations for additional languages you support — or overrid
}
```

Starlight’s search modal is powered by the [Pagefind](https://pagefind.app/) library.
You can set translations for Pagefind’s UI in the same JSON file using `pagefind` keys:

```json
{
"pagefind.clear_search": "Clear",
"pagefind.load_more": "Load more results",
"pagefind.search_label": "Search this site",
"pagefind.filters_label": "Filters",
"pagefind.zero_results": "No results for [SEARCH_TERM]",
"pagefind.many_results": "[COUNT] results for [SEARCH_TERM]",
"pagefind.one_result": "[COUNT] result for [SEARCH_TERM]",
"pagefind.alt_search": "No results for [SEARCH_TERM]. Showing results for [DIFFERENT_TERM] instead",
"pagefind.search_suggestion": "No results for [SEARCH_TERM]. Try one of the following searches:",
"pagefind.searching": "Searching for [SEARCH_TERM]..."
}
```

</Steps>

### Extend translation schema
Expand Down
13 changes: 8 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ export default tseslint.config(
},
},
},
// Disabled typed linting in JavaScript files.
{
files: ['**/*.js', '**/*.cjs', '**/*.mjs'],
extends: [tseslint.configs.disableTypeChecked],
},

// Disable all formatting rules.
prettierConfig,
Expand Down Expand Up @@ -82,6 +77,14 @@ export default tseslint.config(
// fallbacks for some types that may not be accessible in some user environments, e.g. i18n
// keys for plugins.
'@typescript-eslint/no-redundant-type-constituents': 'off',
// Allow for using async event handlers without needing to use an async IIFE.
'@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
},
},

// Disabled typed linting in JavaScript files.
{
files: ['**/*.js', '**/*.cjs', '**/*.mjs'],
extends: [tseslint.configs.disableTypeChecked],
}
);
Loading
Loading