docs: clarification for duplicate pathes in case of dedicated search page #678

This commit is contained in:
Sören Weber 2023-10-07 19:19:33 +02:00
parent bf788d8a3e
commit aa0f4089cb
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -144,7 +144,7 @@ This will generate a search index file at the root of your public folder ready t
### Activate dedicated search page
You can add a dedicated search page for your page by adding the `SEARCHPAGE` outputformat to your home page by adding the following lines in your `config.toml` file.
You can add a dedicated search page for your page by adding the `SEARCHPAGE` outputformat to your home page by adding the following lines in your `config.toml` file. This will cause Hugo to generate a new file `http://example.com/mysite/search.html`.
```toml
[outputs]
@ -155,6 +155,12 @@ You can access this page by either clicking on the magnifier glass or by typing
![Screenshot of the dedicated search page](search_page.png?&width=60pc)
{{% notice note %}}
To have Hugo create the dedicated search page successfully, you must not generate the URL `http://example.com/mysite/search.html` from your own content. This can happen if you set `uglyURLs=true` in your `config.toml` and defining a Markdown file `content/search.md`.
To make sure, there is no duplicate content for any given URL of your project, run `hugo --printPathWarnings`.
{{% /notice %}}
## Activate print support
You can activate print support to add the capability to print whole chapters or even the complete site. Just add the `PRINT` output format to your home, section and page in your `config.toml` as seen below: