Search

Add client-side search to your documentation.

doc2go can include a search box in your generated website, allowing users to perform full-text search across your documentation. This functionality is powered by Pagefind, making this entirely client-side and static.

Try out one of the following examples:

By default, the search functionality is enabled automatically if pagefind is found installed on your system $PATH. Use the official installation instructions to install pagefind on your system.

You can explicitly enable or disable search with the -pagefind flag:

doc2go -pagefind       ./...  # enabled
doc2go -pagefind=false ./...  # disabled

If you have pagefind installed in a non-standard location, pass that location instead of true or false:

doc2go -pagefind=path/to/pagefind ./...

Project-local installation

If you’d like to keep the installation of pagefind local to your project, you can install it with NPM and pass the location to the -pagefind flag.

Take the following steps:

  1. Install pagefind with NPM:

    npm install pagefind@latest
    

    This will create a node_modules/.bin/pagefind executable.

  2. Run doc2go with this path as an argument:

    doc2go -pagefind=node_modules/.bin/pagefind ./...
    
Last modified February 26, 2024: Upgrade to latest Hugo (#214) (0f851c2)