Search
Files: src/config/config.toml · Skill level: Beginner
Taskly has built-in site search powered by Pagefind. It runs in the visitor’s browser, so there is no search service to sign up for.
How Visitors Use It
- Click the search button in the header, or press ⌘ + K (Ctrl + K on Windows and Linux), or /.
- Type: results appear grouped by Pages, Blog, Changelog, and Integrations.
- Use the arrow keys and Enter to open a result, Esc to close. The cookie card steps out of the way while the window is open.
- The search box on the help center (
/help/) opens the same window with the words already typed.
It Only Works On A Built Site
The search index is created at the end of npm run build, into dist/pagefind/. In npm run dev there is no index, and the search window says so. To try search on your computer:
npm run buildnpm run previewSettings
[settings.search] enable = true # false removes the header button, the window, and the index markers exclude = [] # path prefixes to leave out, without the language prefix, e.g. ["changelog"]What Is Indexed
Only the main content of each page (not the header, call to action, or footer). Left out automatically:
- the auth screens and the 404 page
- pages with
robots: "noindex"(including/elements/) - paginated lists and blog category and tag pages, which only repeat their entries
- pages with
excludeFromSearch: truein their frontmatter (the legal pages ship with it)
To keep one part of a page out of the results, wrap it in an element with the data-pagefind-ignore attribute.
Do It With AI
Leave the changelog and the legal pages out of site search, and change the search placeholder to"[TEXT]" in English and French. Use [settings.search] exclude in src/config/config.toml andsearch.placeholder in src/i18n/en.json and fr.json.