From be7ebb94a68ff59f17d81a2f35f92d7cd345b7fe Mon Sep 17 00:00:00 2001 From: LisaFC Date: Mon, 9 Jan 2023 15:45:10 +0000 Subject: [PATCH 01/13] Create search.md Part of fix for #1047 --- .../content/en/docs/adding-content/search.md | 279 ++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 userguide/content/en/docs/adding-content/search.md diff --git a/userguide/content/en/docs/adding-content/search.md b/userguide/content/en/docs/adding-content/search.md new file mode 100644 index 0000000000..f708d22227 --- /dev/null +++ b/userguide/content/en/docs/adding-content/search.md @@ -0,0 +1,279 @@ +--- +title: "Search" +date: 2017-01-05 +weight: 3.5 +description: > + Let users search your Docsy site with a choice of configurable search options. +--- + +Docsy offers multiple options that let your readers search your site content, so you can pick one that suits your needs. You can choose from: + +* [Google Custom Search Engine](#configure-search-with-a-google-custom-search-engine) (GCSE), the default option, which uses Google's index of your public site to generate a search results page. +* [Algolia DocSearch](#configure-algolia-docsearch), which uses Algolia's indexing and search mechanism, and provides an organized dropdown of search results when your readers use the search box. Algolia DocSearch is free for public documentation sites. +* [Local search with Lunr](#configure-local-search-with-lunr), which uses Javascript to index and search your site without the need to connect to external services. This option doesn't require your site to be public. + +If you enable any of these search options in your `config.toml`, a search box displays in the right of your top navigation bar. By default a search box also displays at the top of the section menu in the left navigation pane, which you can disable if you prefer, or if you're using a search option that only works with the top search box. + +Be aware that if you accidentally enable more than one search option in your `config.toml` you may get unexpected results (for example, if you have added the `.js` for Algolia DocSearch, you'll get Algolia results if you enable GCSE search but forget to disable Algolia search). + +## Disabling the sidebar search box + +By default, the search box appears in both the top navigation bar and at the top of the sidebar left navigation pane. If you don't want the sidebar search box, set `sidebar_search_disable` to `true` in `config.toml`/`config.yaml`/`config.json`: + +{{< tabpane persistLang=false >}} +{{< tab header="Configuration file:" disabled=true />}} +{{< tab header="config.toml" lang="toml" >}} +sidebar_search_disable = true +{{< /tab >}} +{{< tab header="config.yaml" lang="yaml" >}} +sidebar_search_disable: true +{{< /tab >}} +{{< tab header="config.json" lang="json" >}} +"sidebar_search_disable": true +{{< /tab >}} +{{< /tabpane >}} + +## Configure search with a Google Custom Search Engine + +By default Docsy uses a [Google Custom Search Engine](https://cse.google.com/cse/all) (GCSE) to search your site. To enable this feature, you'll first need to make sure that you have built and deployed [a production version of your site](/docs/deployment#build-environments-and-indexing), as otherwise your site won't be crawled and indexed. + +### Setting up site search + +1. Create a Google Custom Search Engine for your deployed site by clicking **New search engine** on the [Custom Search page](https://cse.google.com/cse/all) and following the instructions. Make a note of the ID for your new search engine. +1. Add any further configuration you want to your search engine using the **Edit search engine** options. In particular you may want to do the following: + + * Select **Look and feel**. Change from the default **Overlay** layout to **Results only**, as this option means your search results are embedded in your search page rather than appearing in a separate box. Click **Save** to save your changes. + * Edit the default result link behavior so that search results from your site don't open in a new tab. To do this, select **Search Features** - **Advanced** - **Websearch Settings**. In the **Link Target** field, type "\_parent". Click **Save** to save your changes. + +{{% alert title="Tip" %}} +Your site search results should show up within a couple of days. If it takes longer than that, you can manually request that your site is indexed by [submitting a sitemap through the Google Search Console](https://support.google.com/webmasters/answer/183668?hl=en). +{{% /alert %}} + +### Adding the search page + +Once you have your search engine set up, you can add the feature to your site: + +1. Ensure you have a Markdown file in `content/en/search.md` (and one per other languages if needed) to display your search results. It only needs a title and `layout: search`, as in the following example: + + {{< tabpane persistLang=false >}} +{{< tab header="Front matter:" disabled=true />}} +{{< tab header="toml" lang="toml" >}} ++++ +title = "Search Results" +layout = "search" ++++ +{{< /tab >}} +{{< tab header="yaml" lang="yaml" >}} +--- +title: Search Results +layout: search +--- +{{< /tab >}} +{{< tab header="json" lang="json" >}} +{ + "title": "Search Results", + "layout": "search" +} +{{< /tab >}} + {{< /tabpane >}} + +1. Add your Google Custom Search Engine ID to the site params in `config.toml`/`config.yaml`/`config.json`. You can add different values per language if needed. + + {{< tabpane persistLang=false >}} +{{< tab header="Configuration file:" disabled=true />}} +{{< tab header="config.toml" lang="toml" >}} +gcs_engine_id = "011737558837375720776:fsdu1nryfng" +{{< /tab >}} +{{< tab header="config.yaml" lang="yaml" >}} +gcs_engine_id: '011737558837375720776:fsdu1nryfng' +{{< /tab >}} +{{< tab header="config.json" lang="json" >}} +{ + "gcs_engine_id": "011737558837375720776:fsdu1nryfng" +} +{{< /tab >}} + {{< /tabpane >}} + + +### Disabling GCSE search + +If you don't specify a Google Custom Search Engine ID for your project and haven't enabled any other search options, the search box won't appear in your site. If you're using the default `config.toml` from the example site and want to disable search, just comment out or remove the relevant line. + +## Configure Algolia DocSearch + +As an alternative to GCSE, you can use [Algolia DocSearch](https://docsearch.algolia.com/) with this theme. Algolia DocSearch is free for public documentation sites. Docsy supports Algolia DocSearch v3. + +{{% alert title="Note" %}} +Docsy previously supported Algolia DocSearch v2, which is now deprecated. If you are an existing Algolia DocSearch v2 user and want to use the latest Docsy version, [follow the migration instructions](https://docsearch.algolia.com/docs/migrating-from-v2) in the DocSearch documentation to update your DocSearch code snippet. +{{% /alert %}} + +### Sign up for Algolia DocSearch + +Complete the form at [https://docsearch.algolia.com/apply/](https://docsearch.algolia.com/apply/). + +If you are accepted to the program, you will receive the code to add to your documentation site from Algolia by email. + +### Adding Algolia DocSearch + +1. Enable Algolia DocSearch in `config.toml`/`config.yaml`/`config.json`. + + {{< tabpane persistLang=false >}} +{{< tab header="Configuration file:" disabled=true />}} +{{< tab header="config.toml" lang="toml" >}} +algolia_docsearch = true +{{< /tab >}} +{{< tab header="config.yaml" lang="yaml" >}} +algolia_docsearch: true +{{< /tab >}} +{{< tab header="config.json" lang="json" >}} +{ + "algolia_docsearch": true +} +{{< /tab >}} + {{< /tabpane >}} + +2. Remove or comment out any GCSE ID in `config.toml`/`config.yaml`/`config.json` and ensure local search is set to `false` as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). + +3. Disable the sidebar search in `config.toml`/`config.yaml`/`config.json` as this is not currently supported for Algolia DocSearch. See [Disabling the sidebar search box](#disabling-the-sidebar-search-box). + +3. Add the CSS and JS to use Algolia to the head and body of every page in your site, following the instructions in [Add code to head or before body end](/docs/adding-content/lookandfeel/#add-code-to-head-or-before-body-end). + + * In `head-end.html` add the DocSearch CSS: + + ```html + + ``` + + + * In `body-end.html` add the DocSearch script, replacing the `docsearch` details with the snippet you get from Algolia (the example below is Algolia's own site index!). You must provide `#docsearch` as your `container` value as that's the ID of the `div` we provide in Docsy's layout: + + ```html + + + ``` + +You can find out more about how to configure DocSearch in the Algolia DocSearch V3 [Getting started](https://docsearch.algolia.com/docs/DocSearch-v3) guide. + +When you've completed these steps, Algolia search should be enabled on your site. Search results are displayed as a pop-up, so you don't need to add any search results page. + +## Configure local search with Lunr + +[Lunr](https://lunrjs.com/) is a Javascript-based search option that lets you index your site and make it searchable without the need for external, server-side search services. This is a good option particularly for smaller or non-public sites. + +To add Lunr search to your Docsy site: + +1. Enable local search in `config.toml`/`config.yaml`/`config.json`. + + {{< tabpane persistLang=false >}} +{{< tab header="Configuration file:" disabled=true />}} +{{< tab header="config.toml" lang="toml" >}} +offlineSearch = true +{{< /tab >}} +{{< tab header="config.yaml" lang="yaml" >}} +offlineSearch: true +{{< /tab >}} +{{< tab header="config.json" lang="json" >}} +{ + "offlineSearch": true +} +{{< /tab >}} + {{< /tabpane >}} + +2. Remove or comment out any GCSE ID in `config.toml`/`config.yaml`/`config.json` and ensure Algolia DocSearch is set to `false`, as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). + +Once you've completed these steps, local search is enabled for your site and results appear in a drop down when you use the search box. + +{{% alert title="Tip" %}} +If you're [testing this locally](/docs/deployment/#serving-your-site-locally) using Hugo’s local server functionality, you need to build your `offline-search-index.xxx.json` file first by running `hugo`. If you have the Hugo server running while you build `offline-search-index.xxx.json`, you may need to stop the server and restart it in order to see your search results. +{{% /alert %}} + +### Changing the summary length of the local search results + +You can customize the summary length by setting `offlineSearchSummaryLength` in `config.toml`/`config.yaml`/`config.json`. + +{{< tabpane persistLang=false >}} +{{< tab header="Configuration file:" disabled=true />}} +{{< tab header="config.toml" lang="toml" >}} +#Enable offline search with Lunr.js +offlineSearch = true +offlineSearchSummaryLength = 200 +{{< /tab >}} +{{< tab header="config.yaml" lang="yaml" >}} +offlineSearch: true +offlineSearchSummaryLength: 200 +{{< /tab >}} +{{< tab header="config.json" lang="json" >}} +{ + "offlineSearch": true, + "offlineSearchSummaryLength": 200 +} +{{< /tab >}} +{{< /tabpane >}} + +### Changing the maximum result count of the local search + +You can customize the maximum result count by setting `offlineSearchMaxResults` in `config.toml`/`config.yaml`/`config.json`. + +{{< tabpane persistLang=false >}} +{{< tab header="Configuration file:" disabled=true />}} +{{< tab header="config.toml" lang="toml" >}} +offlineSearch = true +offlineSearchMaxResults = 25 +{{< /tab >}} +{{< tab header="config.yaml" lang="yaml" >}} +offlineSearch: true +offlineSearchMaxResults: 25 +{{< /tab >}} +{{< tab header="config.json" lang="json" >}} +{ + "offlineSearch": true, + "offlineSearchMaxResults": 25 +} +{{< /tab >}} +{{< /tabpane >}} + +### Changing the width of the local search results popover + +The width of the search results popover will automatically widen according to the content. + +If you want to limit the width, add the following scss into `assets/scss/_variables_project.scss`. + +```scss +.td-offline-search-results { + max-width: 460px; +} +``` + +### Excluding pages from local search results + +To exclude pages from local search results, add `exclude_search: true` to the the frontmatter of each page: + +{{< tabpane persistLang=false >}} +{{< tab header="Front matter:" disabled=true />}} +{{< tab header="toml" lang="toml" >}} ++++ +title = "Index" +weight = 10 +exclude_search = true ++++ +{{< /tab >}} +{{< tab header="yaml" lang="yaml" >}} +--- +title: "Index" +weight: 10 +exclude_search: true +--- +{{< /tab >}} +{{< tab header="json" lang="json" >}} +{ + "title": "Index", + "weight": 10, + "exclude_search": true +} +{{< /tab >}} +{{< /tabpane >}} From 211be74418fc99455311ef0304fd45a2d0a59f70 Mon Sep 17 00:00:00 2001 From: LisaFC Date: Mon, 9 Jan 2023 15:51:07 +0000 Subject: [PATCH 02/13] Update navigation.md --- .../en/docs/adding-content/navigation.md | 280 +----------------- 1 file changed, 4 insertions(+), 276 deletions(-) diff --git a/userguide/content/en/docs/adding-content/navigation.md b/userguide/content/en/docs/adding-content/navigation.md index 5ea3da7e1a..e5910e7bac 100644 --- a/userguide/content/en/docs/adding-content/navigation.md +++ b/userguide/content/en/docs/adding-content/navigation.md @@ -1,11 +1,13 @@ --- -title: "Navigation and Search" +title: "Navigation and Menus" date: 2017-01-05 weight: 3 description: > - Customize site navigation and search for your Docsy site. + Customize site navigation for your Docsy site. --- +Docsy provides multiple built-in navigation featurs for your sites, including site menus, section menus, and page menus. This page shows you how they work and how to configure and customize them to meet your needs. + ## Top-level menu The top level menu (the one that appears in the top navigation bar for the entire site) uses your site's [`main` menu](https://gohugo.io/content-management/menus/). All Hugo sites have a `main` menu array of menu entries, accessible via the `.Site.Menus` site variable and populatable via page front matter or your site's `config.toml`/`config.yaml`/`config.json`. @@ -250,277 +252,3 @@ To create a placeholder page, create a page file as usual in the directory where Breadcrumb navigation links appear at the top of each page by default. To disable breadcrumb navigation, set site param `ui.breadcrumb_disable = true` in `config.toml`. Breadcrumb navigation links are also shown for each item on the taxonomy results page (i.e. when you click one of the taxonomy labels, e.g. Tags/Categories). These breadcrumbs can be disabled in `config.toml` by setting site param `taxonomy_breadcrumb_disable = true`. - -## Site search options - -Docsy offers multiple options that let your readers search your site content, so you can pick one that suits your needs. You can choose from: - -* [Google Custom Search Engine](#configure-search-with-a-google-custom-search-engine) (GCSE), the default option, which uses Google's index of your public site to generate a search results page. -* [Algolia DocSearch](#configure-algolia-docsearch), which uses Algolia's indexing and search mechanism, and provides an organized dropdown of search results when your readers use the search box. Algolia DocSearch is free for public documentation sites. -* [Local search with Lunr](#configure-local-search-with-lunr), which uses Javascript to index and search your site without the need to connect to external services. This option doesn't require your site to be public. - -If you enable any of these search options in your `config.toml`, a search box displays in the right of your top navigation bar. By default a search box also displays at the top of the section menu in the left navigation pane, which you can disable if you prefer, or if you're using a search option that only works with the top search box. - -Be aware that if you accidentally enable more than one search option in your `config.toml` you may get unexpected results (for example, if you have added the `.js` for Algolia DocSearch, you'll get Algolia results if you enable GCSE search but forget to disable Algolia search). - -### Disabling the sidebar search box - -By default, the search box appears in both the top navigation bar and at the top of the sidebar left navigation pane. If you don't want the sidebar search box, set `sidebar_search_disable` to `true` in `config.toml`/`config.yaml`/`config.json`: - -{{< tabpane persistLang=false >}} -{{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} -sidebar_search_disable = true -{{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} -sidebar_search_disable: true -{{< /tab >}} -{{< tab header="config.json" lang="json" >}} -"sidebar_search_disable": true -{{< /tab >}} -{{< /tabpane >}} - -## Configure search with a Google Custom Search Engine - -By default Docsy uses a [Google Custom Search Engine](https://cse.google.com/cse/all) (GCSE) to search your site. To enable this feature, you'll first need to make sure that you have built and deployed [a production version of your site](/docs/deployment#build-environments-and-indexing), as otherwise your site won't be crawled and indexed. - -### Setting up site search - -1. Create a Google Custom Search Engine for your deployed site by clicking **New search engine** on the [Custom Search page](https://cse.google.com/cse/all) and following the instructions. Make a note of the ID for your new search engine. -1. Add any further configuration you want to your search engine using the **Edit search engine** options. In particular you may want to do the following: - - * Select **Look and feel**. Change from the default **Overlay** layout to **Results only**, as this option means your search results are embedded in your search page rather than appearing in a separate box. Click **Save** to save your changes. - * Edit the default result link behavior so that search results from your site don't open in a new tab. To do this, select **Search Features** - **Advanced** - **Websearch Settings**. In the **Link Target** field, type "\_parent". Click **Save** to save your changes. - -{{% alert title="Tip" %}} -Your site search results should show up within a couple of days. If it takes longer than that, you can manually request that your site is indexed by [submitting a sitemap through the Google Search Console](https://support.google.com/webmasters/answer/183668?hl=en). -{{% /alert %}} - -### Adding the search page - -Once you have your search engine set up, you can add the feature to your site: - -1. Ensure you have a Markdown file in `content/en/search.md` (and one per other languages if needed) to display your search results. It only needs a title and `layout: search`, as in the following example: - - {{< tabpane persistLang=false >}} -{{< tab header="Front matter:" disabled=true />}} -{{< tab header="toml" lang="toml" >}} -+++ -title = "Search Results" -layout = "search" -+++ -{{< /tab >}} -{{< tab header="yaml" lang="yaml" >}} ---- -title: Search Results -layout: search ---- -{{< /tab >}} -{{< tab header="json" lang="json" >}} -{ - "title": "Search Results", - "layout": "search" -} -{{< /tab >}} - {{< /tabpane >}} - -1. Add your Google Custom Search Engine ID to the site params in `config.toml`/`config.yaml`/`config.json`. You can add different values per language if needed. - - {{< tabpane persistLang=false >}} -{{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} -gcs_engine_id = "011737558837375720776:fsdu1nryfng" -{{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} -gcs_engine_id: '011737558837375720776:fsdu1nryfng' -{{< /tab >}} -{{< tab header="config.json" lang="json" >}} -{ - "gcs_engine_id": "011737558837375720776:fsdu1nryfng" -} -{{< /tab >}} - {{< /tabpane >}} - - -### Disabling GCSE search - -If you don't specify a Google Custom Search Engine ID for your project and haven't enabled any other search options, the search box won't appear in your site. If you're using the default `config.toml` from the example site and want to disable search, just comment out or remove the relevant line. - -## Configure Algolia DocSearch - -As an alternative to GCSE, you can use [Algolia DocSearch](https://docsearch.algolia.com/) with this theme. Algolia DocSearch is free for public documentation sites. Docsy supports Algolia DocSearch v3. - -{{% alert title="Note" %}} -Docsy previously supported Algolia DocSearch v2, which is now deprecated. If you are an existing Algolia DocSearch v2 user and want to use the latest Docsy version, [follow the migration instructions](https://docsearch.algolia.com/docs/migrating-from-v2) in the DocSearch documentation to update your DocSearch code snippet. -{{% /alert %}} - -### Sign up for Algolia DocSearch - -Complete the form at [https://docsearch.algolia.com/apply/](https://docsearch.algolia.com/apply/). - -If you are accepted to the program, you will receive the code to add to your documentation site from Algolia by email. - -### Adding Algolia DocSearch - -1. Enable Algolia DocSearch in `config.toml`/`config.yaml`/`config.json`. - - {{< tabpane persistLang=false >}} -{{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} -algolia_docsearch = true -{{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} -algolia_docsearch: true -{{< /tab >}} -{{< tab header="config.json" lang="json" >}} -{ - "algolia_docsearch": true -} -{{< /tab >}} - {{< /tabpane >}} - -2. Remove or comment out any GCSE ID in `config.toml`/`config.yaml`/`config.json` and ensure local search is set to `false` as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). - -3. Disable the sidebar search in `config.toml`/`config.yaml`/`config.json` as this is not currently supported for Algolia DocSearch. See [Disabling the sidebar search box](#disabling-the-sidebar-search-box). - -3. Add the CSS and JS to use Algolia to the head and body of every page in your site, following the instructions in [Add code to head or before body end](/docs/adding-content/lookandfeel/#add-code-to-head-or-before-body-end). - - * In `head-end.html` add the DocSearch CSS: - - ```html - - ``` - - - * In `body-end.html` add the DocSearch script, replacing the `docsearch` details with the snippet you get from Algolia (the example below is Algolia's own site index!). You must provide `#docsearch` as your `container` value as that's the ID of the `div` we provide in Docsy's layout: - - ```html - - - ``` - -You can find out more about how to configure DocSearch in the Algolia DocSearch V3 [Getting started](https://docsearch.algolia.com/docs/DocSearch-v3) guide. - -When you've completed these steps, Algolia search should be enabled on your site. Search results are displayed as a pop-up, so you don't need to add any search results page. - -## Configure local search with Lunr - -[Lunr](https://lunrjs.com/) is a Javascript-based search option that lets you index your site and make it searchable without the need for external, server-side search services. This is a good option particularly for smaller or non-public sites. - -To add Lunr search to your Docsy site: - -1. Enable local search in `config.toml`/`config.yaml`/`config.json`. - - {{< tabpane persistLang=false >}} -{{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} -offlineSearch = true -{{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} -offlineSearch: true -{{< /tab >}} -{{< tab header="config.json" lang="json" >}} -{ - "offlineSearch": true -} -{{< /tab >}} - {{< /tabpane >}} - -2. Remove or comment out any GCSE ID in `config.toml`/`config.yaml`/`config.json` and ensure Algolia DocSearch is set to `false`, as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). - -Once you've completed these steps, local search is enabled for your site and results appear in a drop down when you use the search box. - -{{% alert title="Tip" %}} -If you're [testing this locally](/docs/deployment/#serving-your-site-locally) using Hugo’s local server functionality, you need to build your `offline-search-index.xxx.json` file first by running `hugo`. If you have the Hugo server running while you build `offline-search-index.xxx.json`, you may need to stop the server and restart it in order to see your search results. -{{% /alert %}} - -### Changing the summary length of the local search results - -You can customize the summary length by setting `offlineSearchSummaryLength` in `config.toml`/`config.yaml`/`config.json`. - -{{< tabpane persistLang=false >}} -{{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} -#Enable offline search with Lunr.js -offlineSearch = true -offlineSearchSummaryLength = 200 -{{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} -offlineSearch: true -offlineSearchSummaryLength: 200 -{{< /tab >}} -{{< tab header="config.json" lang="json" >}} -{ - "offlineSearch": true, - "offlineSearchSummaryLength": 200 -} -{{< /tab >}} -{{< /tabpane >}} - -### Changing the maximum result count of the local search - -You can customize the maximum result count by setting `offlineSearchMaxResults` in `config.toml`/`config.yaml`/`config.json`. - -{{< tabpane persistLang=false >}} -{{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} -offlineSearch = true -offlineSearchMaxResults = 25 -{{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} -offlineSearch: true -offlineSearchMaxResults: 25 -{{< /tab >}} -{{< tab header="config.json" lang="json" >}} -{ - "offlineSearch": true, - "offlineSearchMaxResults": 25 -} -{{< /tab >}} -{{< /tabpane >}} - -### Changing the width of the local search results popover - -The width of the search results popover will automatically widen according to the content. - -If you want to limit the width, add the following scss into `assets/scss/_variables_project.scss`. - -```scss -.td-offline-search-results { - max-width: 460px; -} -``` - -### Excluding pages from local search results - -To exclude pages from local search results, add `exclude_search: true` to the the frontmatter of each page: - -{{< tabpane persistLang=false >}} -{{< tab header="Front matter:" disabled=true />}} -{{< tab header="toml" lang="toml" >}} -+++ -title = "Index" -weight = 10 -exclude_search = true -+++ -{{< /tab >}} -{{< tab header="yaml" lang="yaml" >}} ---- -title: "Index" -weight: 10 -exclude_search: true ---- -{{< /tab >}} -{{< tab header="json" lang="json" >}} -{ - "title": "Index", - "weight": 10, - "exclude_search": true -} -{{< /tab >}} -{{< /tabpane >}} From cc1f977a593881e78650717d69843f38e30122d0 Mon Sep 17 00:00:00 2001 From: LisaFC Date: Mon, 9 Jan 2023 15:57:42 +0000 Subject: [PATCH 03/13] Fix broken link --- userguide/content/en/docs/get-started/basic-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userguide/content/en/docs/get-started/basic-configuration.md b/userguide/content/en/docs/get-started/basic-configuration.md index 19875ea429..57fcd76c63 100644 --- a/userguide/content/en/docs/get-started/basic-configuration.md +++ b/userguide/content/en/docs/get-started/basic-configuration.md @@ -44,7 +44,7 @@ By default, the Docsy example site uses its own [Google Custom Search Engine](ht gcs_engine_id = "011737558837375720776:fsdu1nryfng" ``` -To use your own Custom Search Engine, replace the value in the `gcs_engine_id` with the ID of your own search engine. Or [choose another search option](/docs/adding-content/navigation/#site-search-options). +To use your own Custom Search Engine, replace the value in the `gcs_engine_id` with the ID of your own search engine. Or [choose another search option](/docs/adding-content/search). ## What's next? From 6d64385287a118ddf08b9e73f4e1f59290cfe42d Mon Sep 17 00:00:00 2001 From: LisaFC Date: Mon, 9 Jan 2023 15:58:46 +0000 Subject: [PATCH 04/13] Fix broken link --- userguide/content/en/docs/Deployment/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userguide/content/en/docs/Deployment/_index.md b/userguide/content/en/docs/Deployment/_index.md index 8b4d51ac77..4401263e1d 100644 --- a/userguide/content/en/docs/Deployment/_index.md +++ b/userguide/content/en/docs/Deployment/_index.md @@ -19,7 +19,7 @@ Now that you're serving your site locally, Hugo will watch for changes to the co ## Build environments and indexing -By default, Hugo sites built with `hugo` (rather than served locally with `hugo server`) have the Hugo build environment `production`. Deployed Docsy sites with `production` builds can be indexed by search engines, including [Google Custom Search Engines](/docs/adding-content/navigation/#configure-search-with-a-google-custom-search-engine). Production builds also have optimized JavaScript and CSS for live deployment (for example, minified JS rather than the more legible original source). +By default, Hugo sites built with `hugo` (rather than served locally with `hugo server`) have the Hugo build environment `production`. Deployed Docsy sites with `production` builds can be indexed by search engines, including [Google Custom Search Engines](/docs/adding-content/search/#configure-search-with-a-google-custom-search-engine). Production builds also have optimized JavaScript and CSS for live deployment (for example, minified JS rather than the more legible original source). If you do not want your deployed site to be indexed by search engines (for example if you are still developing your live site), or if you want to build a development version of your site for offline analysis, you can set your Hugo build environment to something else such as `development` (the default for local deploys with `hugo server`), `test`, or another environment name of your choice. From 5d0ec6cfecc34064a65b540d524af4840352a99d Mon Sep 17 00:00:00 2001 From: LisaFC Date: Wed, 12 Jul 2023 15:14:08 +0100 Subject: [PATCH 05/13] Update userguide/content/en/docs/adding-content/navigation.md Co-authored-by: Patrice Chalin --- userguide/content/en/docs/adding-content/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userguide/content/en/docs/adding-content/navigation.md b/userguide/content/en/docs/adding-content/navigation.md index d70f870028..136505f444 100644 --- a/userguide/content/en/docs/adding-content/navigation.md +++ b/userguide/content/en/docs/adding-content/navigation.md @@ -1,5 +1,5 @@ --- -title: "Navigation and Menus" +title: Navigation and Menus date: 2017-01-05 weight: 3 description: > From d48c1a1fc9ffe0d44a88a87e90180f9bb5dd96fe Mon Sep 17 00:00:00 2001 From: LisaFC Date: Wed, 12 Jul 2023 15:14:22 +0100 Subject: [PATCH 06/13] Update userguide/content/en/docs/adding-content/navigation.md Co-authored-by: Patrice Chalin --- userguide/content/en/docs/adding-content/navigation.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/userguide/content/en/docs/adding-content/navigation.md b/userguide/content/en/docs/adding-content/navigation.md index 136505f444..641b2f9cd1 100644 --- a/userguide/content/en/docs/adding-content/navigation.md +++ b/userguide/content/en/docs/adding-content/navigation.md @@ -2,8 +2,7 @@ title: Navigation and Menus date: 2017-01-05 weight: 3 -description: > - Customize site navigation for your Docsy site. +description: Customize site navigation for your Docsy site. --- Docsy provides multiple built-in navigation features for your sites, including site menus, section menus, and page menus. This page shows you how they work and how to configure and customize them to meet your needs. From 0deafea1fcedfc4a43f7c233698b2fdc2eeb00c0 Mon Sep 17 00:00:00 2001 From: LisaFC Date: Wed, 12 Jul 2023 15:14:49 +0100 Subject: [PATCH 07/13] Update userguide/content/en/docs/adding-content/search.md Co-authored-by: Patrice Chalin --- userguide/content/en/docs/adding-content/search.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userguide/content/en/docs/adding-content/search.md b/userguide/content/en/docs/adding-content/search.md index f708d22227..45fb5ff0dc 100644 --- a/userguide/content/en/docs/adding-content/search.md +++ b/userguide/content/en/docs/adding-content/search.md @@ -1,5 +1,5 @@ --- -title: "Search" +title: Search date: 2017-01-05 weight: 3.5 description: > From 0128cde46086305b45ab013ac232a798d35147ad Mon Sep 17 00:00:00 2001 From: LisaFC Date: Wed, 12 Jul 2023 15:24:16 +0100 Subject: [PATCH 08/13] Update _index.md Resolve merge issues --- userguide/content/en/docs/Deployment/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userguide/content/en/docs/Deployment/_index.md b/userguide/content/en/docs/Deployment/_index.md index 00b3ad5c07..63a278dcbf 100644 --- a/userguide/content/en/docs/Deployment/_index.md +++ b/userguide/content/en/docs/Deployment/_index.md @@ -42,7 +42,7 @@ Then follow the instructions in [Host on Netlify](https://gohugo.io/hosting-and- 1. In the **Deploy settings** page: 1. Specify your **Build command**. The exact build command depends on how you have chosen to use Docsy: * If you are using Docsy as a [Git submodule](/docs/get-started/other-options/#option-1-docsy-as-a-git-submodule), specify `cd themes/docsy && git submodule update -f --init && cd ../.. && hugo`. You need to specify this rather than just `hugo` so that Netlify can use the theme's submodules. - * If you are using Docsy as a [Hugo module](/docs/get-started/docsy-as-module/) or NPM package, you can just specify `hugo`. + * If you are using Docsy as a [Hugo module](/docs/get-started/docsy-as-module/) or NPM package, you can just specify `hugo`. 3. Click **Show advanced**. 4. In the **Advanced build settings** section, click **New variable**. 5. Specify `HUGO_VERSION` as the **Key** for the new variable, and set its **Value** to the latest version of Hugo (minimum required version: `0.110.0`). @@ -90,7 +90,7 @@ There are several options for publishing your web site using [Amazon Web Service 1. Inside your `hugo.toml`/`hugo.yaml`/`hugo.json`, add a `[deployment]` section like this one: - {{< tabpane persistLang=false >}} + {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="hugo.toml" lang="toml" >}} [deployment] From 886d33ebb4ad0e9c0f8388890abbaad240a05eb1 Mon Sep 17 00:00:00 2001 From: LisaFC Date: Wed, 12 Jul 2023 15:42:16 +0100 Subject: [PATCH 09/13] More merge fixing --- .../content/en/docs/adding-content/navigation.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/userguide/content/en/docs/adding-content/navigation.md b/userguide/content/en/docs/adding-content/navigation.md index 641b2f9cd1..f53a4ea9b5 100644 --- a/userguide/content/en/docs/adding-content/navigation.md +++ b/userguide/content/en/docs/adding-content/navigation.md @@ -13,7 +13,7 @@ The top level menu (the one that appears in the top navigation bar for the entir To add a page or section to this menu, add it to the site's `main` menu in either `hugo.toml`/`hugo.yaml`/`hugo.json` or in the destination page's front matter (in `_index.md` or `_index.html` for a section, as that's the section landing page). For example, here's how we added the Documentation section landing page to the main menu in this site: -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Front matter:" disabled=true />}} {{< tab header="toml" lang="toml" >}} +++ @@ -53,7 +53,7 @@ The menu is ordered from left to right by page `weight`. So, for example, a sect If you want to add a link to an external site to this menu, add it in `hugo.toml`/`hugo.yaml`/`hugo.json`, specifying the `weight`. -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="hugo.toml" lang="toml" >}} [[menu.main]] @@ -87,7 +87,7 @@ menu: As described in the [Hugo docs](https://gohugo.io/content-management/menus/#add-non-content-entries-to-a-menu), you can add icons to the top-level menu by using the pre and/or post parameter for main menu items defined in your site's `hugo.toml`/`hugo.yaml`/`hugo.json` or via page front matter. For example, the following configuration adds the GitHub icon to the GitHub menu item, and a **New!** alert to indicate that this is a new addition to the menu. -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="hugo.toml" lang="toml" >}} [[menu.main]] @@ -144,7 +144,7 @@ You can find out more in [Multi-language support](/docs/language/). The section menu, as shown in the left side of the `docs` section, is automatically built from the `content` tree. Like the top-level menu, it is ordered by page or section index `weight` (or by page creation `date` if `weight` is not set), with the page or index's `Title`, or `linkTitle` if different, as its link title in the menu. If a section subfolder has pages other than `_index.md` or `_index.html`, those pages will appear as a submenu, again ordered by `weight`. For example, here's the metadata for this page showing its `weight` and `title`: -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Front matter:" disabled=true />}} {{< tab header="toml" lang="toml" >}} +++ @@ -182,7 +182,7 @@ To hide a page or section from the left navigation menu, set `toc_hide: true` in To hide a page from the section summary on a [docs section landing page]({{< ref "content#docs-section-landing-pages" >}}), set `hide_summary: true` in the front matter. If you want to hide a page from both the TOC menu and the section summary list, you need to set both `toc_hide` and `hide_summary` to `true` in the front matter. -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Front matter:" disabled=true />}} {{< tab header="toml" lang="toml" >}} +++ @@ -228,7 +228,7 @@ On large sites (default: > 2000 pages) the section menu is not generated for eac The tabbed pane below lists the menu section options you can define in your project [configuration file]. -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}}{{< tab header="hugo.toml" lang="toml" >}} [params.ui] sidebar_menu_compact = true @@ -287,7 +287,7 @@ Breadcrumb navigation links are also shown for each item on the taxonomy results The tabbed pane below lists the breadcrumb navigation options you can define in your project [configuration file]. -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}}{{< tab header="hugo.toml" lang="toml" >}} [params.ui] breadcrumb_disable = true @@ -309,4 +309,4 @@ params: } } {{< /tab >}} -{{< /tabpane >}} \ No newline at end of file +{{< /tabpane >}} From 3fdf5abce5081c6d89437d869ab88eead5290a2d Mon Sep 17 00:00:00 2001 From: LisaFC Date: Wed, 12 Jul 2023 15:44:06 +0100 Subject: [PATCH 10/13] Update search.md --- .../content/en/docs/adding-content/search.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/userguide/content/en/docs/adding-content/search.md b/userguide/content/en/docs/adding-content/search.md index 45fb5ff0dc..da3826b41e 100644 --- a/userguide/content/en/docs/adding-content/search.md +++ b/userguide/content/en/docs/adding-content/search.md @@ -20,7 +20,7 @@ Be aware that if you accidentally enable more than one search option in your `co By default, the search box appears in both the top navigation bar and at the top of the sidebar left navigation pane. If you don't want the sidebar search box, set `sidebar_search_disable` to `true` in `config.toml`/`config.yaml`/`config.json`: -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="config.toml" lang="toml" >}} sidebar_search_disable = true @@ -55,7 +55,7 @@ Once you have your search engine set up, you can add the feature to your site: 1. Ensure you have a Markdown file in `content/en/search.md` (and one per other languages if needed) to display your search results. It only needs a title and `layout: search`, as in the following example: - {{< tabpane persistLang=false >}} + {{< tabpane >}} {{< tab header="Front matter:" disabled=true />}} {{< tab header="toml" lang="toml" >}} +++ @@ -79,7 +79,7 @@ layout: search 1. Add your Google Custom Search Engine ID to the site params in `config.toml`/`config.yaml`/`config.json`. You can add different values per language if needed. - {{< tabpane persistLang=false >}} + {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="config.toml" lang="toml" >}} gcs_engine_id = "011737558837375720776:fsdu1nryfng" @@ -117,7 +117,7 @@ If you are accepted to the program, you will receive the code to add to your doc 1. Enable Algolia DocSearch in `config.toml`/`config.yaml`/`config.json`. - {{< tabpane persistLang=false >}} + {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="config.toml" lang="toml" >}} algolia_docsearch = true @@ -169,7 +169,7 @@ To add Lunr search to your Docsy site: 1. Enable local search in `config.toml`/`config.yaml`/`config.json`. - {{< tabpane persistLang=false >}} + {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="config.toml" lang="toml" >}} offlineSearch = true @@ -196,7 +196,7 @@ If you're [testing this locally](/docs/deployment/#serving-your-site-locally) us You can customize the summary length by setting `offlineSearchSummaryLength` in `config.toml`/`config.yaml`/`config.json`. -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="config.toml" lang="toml" >}} #Enable offline search with Lunr.js @@ -219,7 +219,7 @@ offlineSearchSummaryLength: 200 You can customize the maximum result count by setting `offlineSearchMaxResults` in `config.toml`/`config.yaml`/`config.json`. -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} {{< tab header="config.toml" lang="toml" >}} offlineSearch = true @@ -253,7 +253,7 @@ If you want to limit the width, add the following scss into `assets/scss/_variab To exclude pages from local search results, add `exclude_search: true` to the the frontmatter of each page: -{{< tabpane persistLang=false >}} +{{< tabpane >}} {{< tab header="Front matter:" disabled=true />}} {{< tab header="toml" lang="toml" >}} +++ From 3f2931a3dc5761863608b7bfd47b48f72965851f Mon Sep 17 00:00:00 2001 From: LisaFC Date: Wed, 12 Jul 2023 15:47:25 +0100 Subject: [PATCH 11/13] more merge fixing --- userguide/content/en/docs/adding-content/navigation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userguide/content/en/docs/adding-content/navigation.md b/userguide/content/en/docs/adding-content/navigation.md index f53a4ea9b5..0722f894cf 100644 --- a/userguide/content/en/docs/adding-content/navigation.md +++ b/userguide/content/en/docs/adding-content/navigation.md @@ -94,7 +94,7 @@ As described in the [Hugo docs](https://gohugo.io/content-management/menus/#add- name = "GitHub" weight = 50 url = "https://github.com/google/docsy/" - pre = "" + pre = "" post = "New!" {{< /tab >}} {{< tab header="hugo.yaml" lang="yaml" >}} @@ -103,7 +103,7 @@ menu: - name: GitHub weight: 50 url: 'https://github.com/google/docsy/' - pre: + pre: post: New! {{< /tab >}} {{< tab header="hugo.json" lang="json" >}} From bd9deb343378ff5369daeb25611f5edd1b93f725 Mon Sep 17 00:00:00 2001 From: LisaFC Date: Thu, 13 Jul 2023 16:55:41 +0100 Subject: [PATCH 12/13] Update search.md --- .../content/en/docs/adding-content/search.md | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/userguide/content/en/docs/adding-content/search.md b/userguide/content/en/docs/adding-content/search.md index da3826b41e..7ccec382e5 100644 --- a/userguide/content/en/docs/adding-content/search.md +++ b/userguide/content/en/docs/adding-content/search.md @@ -18,17 +18,17 @@ Be aware that if you accidentally enable more than one search option in your `co ## Disabling the sidebar search box -By default, the search box appears in both the top navigation bar and at the top of the sidebar left navigation pane. If you don't want the sidebar search box, set `sidebar_search_disable` to `true` in `config.toml`/`config.yaml`/`config.json`: +By default, the search box appears in both the top navigation bar and at the top of the sidebar left navigation pane. If you don't want the sidebar search box, set `sidebar_search_disable` to `true` in `hugo.toml`/`hugo.yaml`/`hugo.json`: {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} +{{< tab header="hugo.toml" lang="toml" >}} sidebar_search_disable = true {{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} +{{< tab header="hugo.yaml" lang="yaml" >}} sidebar_search_disable: true {{< /tab >}} -{{< tab header="config.json" lang="json" >}} +{{< tab header="hugo.json" lang="json" >}} "sidebar_search_disable": true {{< /tab >}} {{< /tabpane >}} @@ -77,17 +77,17 @@ layout: search {{< /tab >}} {{< /tabpane >}} -1. Add your Google Custom Search Engine ID to the site params in `config.toml`/`config.yaml`/`config.json`. You can add different values per language if needed. +1. Add your Google Custom Search Engine ID to the site params in `hugo.toml`/`hugo.yaml`/`hugo.json`. You can add different values per language if needed. {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} +{{< tab header="hugo.toml" lang="toml" >}} gcs_engine_id = "011737558837375720776:fsdu1nryfng" {{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} +{{< tab header="hugo.yaml" lang="yaml" >}} gcs_engine_id: '011737558837375720776:fsdu1nryfng' {{< /tab >}} -{{< tab header="config.json" lang="json" >}} +{{< tab header="hugo.json" lang="json" >}} { "gcs_engine_id": "011737558837375720776:fsdu1nryfng" } @@ -97,7 +97,7 @@ gcs_engine_id: '011737558837375720776:fsdu1nryfng' ### Disabling GCSE search -If you don't specify a Google Custom Search Engine ID for your project and haven't enabled any other search options, the search box won't appear in your site. If you're using the default `config.toml` from the example site and want to disable search, just comment out or remove the relevant line. +If you don't specify a Google Custom Search Engine ID for your project and haven't enabled any other search options, the search box won't appear in your site. If you're using the default `hugo.toml` from the example site and want to disable search, just comment out or remove the relevant line. ## Configure Algolia DocSearch @@ -115,26 +115,26 @@ If you are accepted to the program, you will receive the code to add to your doc ### Adding Algolia DocSearch -1. Enable Algolia DocSearch in `config.toml`/`config.yaml`/`config.json`. +1. Enable Algolia DocSearch in `hugo.toml`/`hugo.yaml`/`hugo.json`. {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} +{{< tab header="hugo.toml" lang="toml" >}} algolia_docsearch = true {{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} +{{< tab header="hugo.yaml" lang="yaml" >}} algolia_docsearch: true {{< /tab >}} -{{< tab header="config.json" lang="json" >}} +{{< tab header="hugo.json" lang="json" >}} { "algolia_docsearch": true } {{< /tab >}} {{< /tabpane >}} -2. Remove or comment out any GCSE ID in `config.toml`/`config.yaml`/`config.json` and ensure local search is set to `false` as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). +2. Remove or comment out any GCSE ID in `hugo.toml`/`hugo.yaml`/`hugo.json` and ensure local search is set to `false` as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). -3. Disable the sidebar search in `config.toml`/`config.yaml`/`config.json` as this is not currently supported for Algolia DocSearch. See [Disabling the sidebar search box](#disabling-the-sidebar-search-box). +3. Disable the sidebar search in `hugo.toml`/`hugo.yaml`/`hugo.json` as this is not currently supported for Algolia DocSearch. See [Disabling the sidebar search box](#disabling-the-sidebar-search-box). 3. Add the CSS and JS to use Algolia to the head and body of every page in your site, following the instructions in [Add code to head or before body end](/docs/adding-content/lookandfeel/#add-code-to-head-or-before-body-end). @@ -167,24 +167,24 @@ When you've completed these steps, Algolia search should be enabled on your site To add Lunr search to your Docsy site: -1. Enable local search in `config.toml`/`config.yaml`/`config.json`. +1. Enable local search in `hugo.toml`/`hugo.yaml`/`hugo.json`. {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} +{{< tab header="hugo.toml" lang="toml" >}} offlineSearch = true {{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} +{{< tab header="hugo.yaml" lang="yaml" >}} offlineSearch: true {{< /tab >}} -{{< tab header="config.json" lang="json" >}} +{{< tab header="hugo.json" lang="json" >}} { "offlineSearch": true } {{< /tab >}} {{< /tabpane >}} -2. Remove or comment out any GCSE ID in `config.toml`/`config.yaml`/`config.json` and ensure Algolia DocSearch is set to `false`, as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). +2. Remove or comment out any GCSE ID in `hugo.toml`/`hugo.yaml`/`hugo.json` and ensure Algolia DocSearch is set to `false`, as you can only have one type of search enabled. See [Disabling GCSE search](#disabling-gcse-search). Once you've completed these steps, local search is enabled for your site and results appear in a drop down when you use the search box. @@ -194,20 +194,20 @@ If you're [testing this locally](/docs/deployment/#serving-your-site-locally) us ### Changing the summary length of the local search results -You can customize the summary length by setting `offlineSearchSummaryLength` in `config.toml`/`config.yaml`/`config.json`. +You can customize the summary length by setting `offlineSearchSummaryLength` in `hugo.toml`/`hugo.yaml`/`hugo.json`. {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} +{{< tab header="hugo.toml" lang="toml" >}} #Enable offline search with Lunr.js offlineSearch = true offlineSearchSummaryLength = 200 {{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} +{{< tab header="hugo.yaml" lang="yaml" >}} offlineSearch: true offlineSearchSummaryLength: 200 {{< /tab >}} -{{< tab header="config.json" lang="json" >}} +{{< tab header="hugo.json" lang="json" >}} { "offlineSearch": true, "offlineSearchSummaryLength": 200 @@ -217,19 +217,19 @@ offlineSearchSummaryLength: 200 ### Changing the maximum result count of the local search -You can customize the maximum result count by setting `offlineSearchMaxResults` in `config.toml`/`config.yaml`/`config.json`. +You can customize the maximum result count by setting `offlineSearchMaxResults` in `hugo.toml`/`hugo.yaml`/`hugo.json`. {{< tabpane >}} {{< tab header="Configuration file:" disabled=true />}} -{{< tab header="config.toml" lang="toml" >}} +{{< tab header="hugo.toml" lang="toml" >}} offlineSearch = true offlineSearchMaxResults = 25 {{< /tab >}} -{{< tab header="config.yaml" lang="yaml" >}} +{{< tab header="hugo.yaml" lang="yaml" >}} offlineSearch: true offlineSearchMaxResults: 25 {{< /tab >}} -{{< tab header="config.json" lang="json" >}} +{{< tab header="hugo.json" lang="json" >}} { "offlineSearch": true, "offlineSearchMaxResults": 25 @@ -277,3 +277,6 @@ exclude_search: true } {{< /tab >}} {{< /tabpane >}} + +[configuration file]: https://gohugo.io/getting-started/configuration/#configuration-file + From de08550d36e911c162c7c194ff19f2a48dece73e Mon Sep 17 00:00:00 2001 From: LisaFC Date: Thu, 13 Jul 2023 17:02:49 +0100 Subject: [PATCH 13/13] Now actually fixed intro --- userguide/content/en/docs/adding-content/search.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userguide/content/en/docs/adding-content/search.md b/userguide/content/en/docs/adding-content/search.md index 7ccec382e5..b31449859b 100644 --- a/userguide/content/en/docs/adding-content/search.md +++ b/userguide/content/en/docs/adding-content/search.md @@ -12,9 +12,9 @@ Docsy offers multiple options that let your readers search your site content, so * [Algolia DocSearch](#configure-algolia-docsearch), which uses Algolia's indexing and search mechanism, and provides an organized dropdown of search results when your readers use the search box. Algolia DocSearch is free for public documentation sites. * [Local search with Lunr](#configure-local-search-with-lunr), which uses Javascript to index and search your site without the need to connect to external services. This option doesn't require your site to be public. -If you enable any of these search options in your `config.toml`, a search box displays in the right of your top navigation bar. By default a search box also displays at the top of the section menu in the left navigation pane, which you can disable if you prefer, or if you're using a search option that only works with the top search box. +If you enable any of these search options in your project [configuration file], a search box displays in the right of your top navigation bar. By default a search box also displays at the top of the section menu in the left navigation pane, which you can disable if you prefer, or if you're using a search option that only works with the top search box. -Be aware that if you accidentally enable more than one search option in your `config.toml` you may get unexpected results (for example, if you have added the `.js` for Algolia DocSearch, you'll get Algolia results if you enable GCSE search but forget to disable Algolia search). +Be aware that if you accidentally enable more than one search option in your project [configuration file], you may get unexpected results (for example, if you have added the `.js` for Algolia DocSearch, you'll get Algolia results if you enable GCSE search but forget to disable Algolia search). ## Disabling the sidebar search box