From aa0f4089cb9c7691e7dc3aff003dddcde1ba02f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 7 Oct 2023 19:19:33 +0200 Subject: [PATCH] docs: clarification for duplicate pathes in case of dedicated search page #678 --- exampleSite/content/basics/configuration/_index.en.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exampleSite/content/basics/configuration/_index.en.md b/exampleSite/content/basics/configuration/_index.en.md index afe44d5e65..6369a5e255 100644 --- a/exampleSite/content/basics/configuration/_index.en.md +++ b/exampleSite/content/basics/configuration/_index.en.md @@ -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: