Allows a page in a Quarto website to immediately display website search results if a query string parameter, q
, is provided in the URL.
This allows a Quarto site to work as custom search engines in browsers and other tools.
Add the extension to your Quarto website with:
quarto add jimjam-slam/quarto-search-page
This will install the extension under the _extensions
subdirectory.
If you're using version control, you will want to check in this directory.
Add the search functionality to a page by adding the following to the document frontmatter:
---
filters:
- quarto-search-page
---
The query string parameter q
is also used to highlight content on a Quarto page, so I recommend you select a single, otherwise empty page (eg. search.qmd
) for this filter.
Then site visitors can search for content by visiting it and providing a q
parameter. For example, if your Quarto website is example.com
and the search page is /search.qmd
, they can search for Hello world
by visiting:
https://example.com/search?v=Hello+world
If you have problems with the extension, please don't hesitate to file an issue!