# Search

## Search

**Files:** `src/config/config.toml` · **Skill level:** Beginner

Taskly has built-in site search powered by [Pagefind](https://pagefind.app/). 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 <kbd>⌘</kbd> + <kbd>K</kbd> (<kbd>Ctrl</kbd> + <kbd>K</kbd> on Windows and Linux), or <kbd>/</kbd>.
- Type: results appear grouped by Pages, Blog, Changelog, and Integrations.
- Use the arrow keys and <kbd>Enter</kbd> to open a result, <kbd>Esc</kbd> 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:

```bash
npm run build
npm run preview
```

### Settings
```toml
[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: true` in 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.

<Aside type="tip">
  Search text (placeholder, "No results", the group names) is in `search` in
  `src/i18n/en.json` and `fr.json`.
</Aside>

### Do It With AI
```text
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 and
search.placeholder in src/i18n/en.json and fr.json.
```