From b14759b265b342d80ca9775356b278a421162cde Mon Sep 17 00:00:00 2001 From: Aleksandr Kadymov Date: Fri, 28 Aug 2026 10:40:00 +0300 Subject: [PATCH] docs(toc): document noIndex behavior --- en/project/meta.md | 11 +++++++++++ en/project/toc.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ en/settings.md | 9 +++++++-- ru/project/meta.md | 11 +++++++++++ ru/project/toc.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ ru/settings.md | 9 +++++++-- 6 files changed, 126 insertions(+), 4 deletions(-) diff --git a/en/project/meta.md b/en/project/meta.md index 63acb9e5..3cedb231 100644 --- a/en/project/meta.md +++ b/en/project/meta.md @@ -54,6 +54,17 @@ Specified in `` and in [##llms.txt##](.. Specified in ``. | `string[]` — || +|| `noIndex` {#no-index} | Disables indexing for the current page and excludes it from `llms.txt` and `llms-full.txt`. + +```yaml +--- +noIndex: true +--- +``` + +The `false` value does not cancel `true` set for the page or its section in [`toc.yaml`](./toc.md#no-index), or the global [`docs-viewer.no-index`](../settings.md#no-index) setting. | `boolean` + +`false` || || `interface` {#interface} | Section with interface display settings. Overrides the settings from the [same-named section of .yfm](../settings.md#interface) for the current page. {% cut "Example with disabling the table of contents on the page" %} diff --git a/en/project/toc.md b/en/project/toc.md index 1b0df3ed..038a8e14 100644 --- a/en/project/toc.md +++ b/en/project/toc.md @@ -153,6 +153,51 @@ To make a section accessible only via a direct link and exclude it from the tabl To completely exclude hidden sections from the build, use the [build key](../tools/docs/settings.md) `--remove-hidden-toc-items=true`. +The `hidden` parameter controls navigation visibility and, together with `--remove-hidden-toc-items`, removal from the build. It does not prohibit indexing. Hidden pages are omitted from `llms.txt` and `llms-full.txt`, but use [`noIndex: true`](#no-index) as well to exclude them from other indexes. + +## Disabling indexing {#no-index} + +To exclude pages from search indexes and from `llms.txt` and `llms-full.txt`, add `noIndex: true`. You can set it at the `toc.yaml` root, on an individual page, or on a section. + +Disable indexing for all documentation in this TOC: + +```yaml +title: Internal documentation +href: index.md +noIndex: true +items: + - name: Getting started + href: start.md +``` + +Disable indexing for an individual page and a section: + +```yaml +items: + - name: Draft + href: draft.md + noIndex: true + - name: Internal section + href: internal/index.md + noIndex: true + items: + - name: Details + href: internal/details.md +``` + +For a section, the restriction applies to its own `href` page and every descendant. A root `noIndex` from an included TOC also applies to the inserted pages. + +The `true` value is cumulative: `noIndex: false` on a nested page does not cancel a restriction from its parent section, the TOC root, or [page metadata](./meta.md#no-index). The global [`.yfm` `docs-viewer.no-index`](../settings.md#no-index) setting cannot be canceled locally either. + +To both hide a page from navigation and disable its indexing, specify both independent parameters: + +```yaml +- name: Service page + href: service.md + hidden: true + noIndex: true +``` + ## Auto-generation of the table of contents To automatically build a table of contents from a list of md files in a folder, you can use the [generic includer](../guides/generic.md). diff --git a/en/settings.md b/en/settings.md index f2518d59..f5343de3 100644 --- a/en/settings.md +++ b/en/settings.md @@ -696,9 +696,14 @@ Examples of links and displayed logos: | — — || -|| `no-index` | Prohibition on indexing by external robots. +|| `no-index` {#no-index} | Globally prohibits external robots from indexing the entire documentation. -It is recommended to use it before public launches so that the document is not displayed in search engines. | `boolean` +```yaml +docs-viewer: + no-index: true +``` + +It is recommended before public launches so that the document is not displayed in search engines. Per-page and per-section [`noIndex`](project/toc.md#no-index) settings cannot cancel the global restriction with `false`. | `boolean` `false` || || `project-name` | Forms the project URL. Requirements: diff --git a/ru/project/meta.md b/ru/project/meta.md index 9f38041c..af6d43dc 100644 --- a/ru/project/meta.md +++ b/ru/project/meta.md @@ -68,6 +68,17 @@ links: Прописывается в ``. | `string[]` — || +|| `noIndex` {#no-index} | Запрещает индексирование текущей страницы и исключает её из `llms.txt` и `llms-full.txt`. + +```yaml +--- +noIndex: true +--- +``` + +Значение `false` не отменяет `true`, установленное для страницы или её раздела в [`toc.yaml`](./toc.md#no-index), либо глобальный [`docs-viewer.no-index`](../settings.md#no-index). | `boolean` + +`false` || || `interface` {#interface} | Секция с настройками отображения интерфейса. Переопределяет установленные в [одноимённой секции .yfm](../settings.md#interface) настройки для текущей страницы. {% cut "Пример с отключением оглавления на странице" %} diff --git a/ru/project/toc.md b/ru/project/toc.md index 57339735..e85c09a3 100644 --- a/ru/project/toc.md +++ b/ru/project/toc.md @@ -153,6 +153,51 @@ items: Для полного исключения скрытых разделов из сборки используйте [ключ сборки](../tools/docs/settings.md) `--remove-hidden-toc-items=true`. +Параметр `hidden` управляет отображением в навигации и, вместе с `--remove-hidden-toc-items`, удалением из сборки. Он не устанавливает запрет на индексирование. Скрытые страницы не попадают в `llms.txt` и `llms-full.txt`, но для запрета другим индексам дополнительно укажите [`noIndex: true`](#no-index). + +## Запрет индексирования {#no-index} + +Чтобы исключить страницы из поисковых индексов, а также из `llms.txt` и `llms-full.txt`, добавьте `noIndex: true`. Параметр можно указать в корне `toc.yaml`, у отдельной страницы или у раздела. + +Запрет для всей документации в этом оглавлении: + +```yaml +title: Внутренняя документация +href: index.md +noIndex: true +items: + - name: Начало работы + href: start.md +``` + +Запрет для отдельной страницы и раздела: + +```yaml +items: + - name: Черновик + href: draft.md + noIndex: true + - name: Внутренний раздел + href: internal/index.md + noIndex: true + items: + - name: Детали + href: internal/details.md +``` + +У раздела запрет применяется к его собственной странице из `href` и ко всем вложенным пунктам. Корневой `noIndex` подключаемого оглавления также распространяется на вставленные страницы. + +Значение `true` накапливается: `noIndex: false` на вложенной странице не отменяет запрет из родительского раздела, корня оглавления или [метаданных страницы](./meta.md#no-index). Глобальный параметр [`.yfm` `docs-viewer.no-index`](../settings.md#no-index) также нельзя отменить локальной настройкой. + +Чтобы одновременно скрыть страницу из навигации и запретить её индексирование, укажите оба независимых параметра: + +```yaml +- name: Служебная страница + href: service.md + hidden: true + noIndex: true +``` + ## Автогенерация оглавления Для автоматического построения оглавления из списка md-файлов в папке можно использовать [generic-инклюдер](../guides/generic.md). diff --git a/ru/settings.md b/ru/settings.md index ef97ed3f..15ce1330 100644 --- a/ru/settings.md +++ b/ru/settings.md @@ -658,9 +658,14 @@ src: | — — || -|| `no-index` | Запрет на индексирование внешними роботами. +|| `no-index` {#no-index} | Глобальный запрет на индексирование всей документации внешними роботами. -Рекомендуется использовать до публичных запусков, чтобы документ не отображался в поисковиках. | `boolean` +```yaml +docs-viewer: + no-index: true +``` + +Рекомендуется использовать до публичных запусков, чтобы документ не отображался в поисковиках. Настройки [`noIndex`](project/toc.md#no-index) отдельных страниц и разделов не могут отменить глобальный запрет значением `false`. | `boolean` `false` || || `project-name` | Формирует URL-адрес проекта. Требования: