Skip to content

Starlight’s Pagefind search is on by default: the index is built by astro build and covers every docs page, local and mounted. The shared header shows Starlight’s search box on docs pages. Exclude one page with frontmatter pagefind: false; turn search off with:

starlight: { pagefind: false }, // the header hides the search box

Another search provider (Algolia DocSearch, …) usually comes as a Starlight plugin that replaces Starlight’s Search component. Add the plugin through starlight.plugins. The shared header only knows about a Search override set in starlight.components, not one a plugin sets, so name the plugin’s component there too:

import docsearch from '@astrojs/starlight-docsearch';
// …
starlight: {
plugins: [docsearch({ appId: '…', apiKey: '…', indexName: '…' })],
components: { Search: '<the search component the plugin documents>' },
pagefind: false,
},

starlight.head adds tags to docs pages only; the landing page and gallery are not Starlight pages. To put a script on every page, add it to a Footer override, which renders on every page, docs included:

src/components/Footer.astro
---
import { SiteFooter } from 'astro-project-site/components';
const { variant } = Astro.props;
---
<SiteFooter variant={variant} />
<script is:inline defer data-domain="my-lib.dev" src="https://plausible.io/js/script.js"></script>
components: { Footer: './src/components/Footer.astro' },

If your _headers has a strict Content-Security-Policy, allow the analytics origin in script-src and connect-src.

astro-project-site

A whole site for your open-source project, from one Astro integration.

© 2026 astro-project-site · v0.1.0-beta.6 · MIT licence. This site is built with itself.