mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
cfca5447f9
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
89 lines
2.5 KiB
Plaintext
89 lines
2.5 KiB
Plaintext
---
|
||
title: "隐藏页面"
|
||
description: "在保持页面可访问的同时,将其从导航中隐藏。"
|
||
keywords: ["hide from navigation", "unlisted", "page visibility"]
|
||
---
|
||
|
||
隐藏页面不会出现在你的网站导航中,但任何知道其URL的人仍可公开访问。
|
||
|
||
当你希望某些内容在站点上可访问,或可作为AI工具的上下文被引用,但又不希望通过导航被发现时,请使用隐藏页面。
|
||
|
||
对于需要严格访问控制的内容,你必须配置[认证](/zh/deploy/authentication-setup)。
|
||
|
||
若要将页面访问限制为特定用户群体,请配置[基于群组的访问控制](/zh/deploy/authentication-setup#control-access-with-groups)。
|
||
|
||
<div id="hiding-a-page">
|
||
## 隐藏页面
|
||
</div>
|
||
|
||
要隐藏页面,请将其从你的导航结构中移除。任何未包含在 `docs.json` navigation 中的页面都会被隐藏。
|
||
|
||
隐藏页面会根据其文件路径使用与常规页面相同的 URL 结构。例如,`guides/hidden-page.mdx` 可通过 `docs.yoursite.com/guides/hidden-page` 访问。
|
||
|
||
参见[隐藏页面示例](/zh/organize/hidden-page-example)。
|
||
|
||
<Note>
|
||
某些导航元素(如侧边栏、下拉菜单和选项卡)在隐藏页面上可能会显示为空或出现布局偏移。
|
||
</Note>
|
||
|
||
<div id="hiding-a-group-of-pages">
|
||
## 隐藏一组页面
|
||
</div>
|
||
|
||
在你的 `docs.json` 文件中将 `hidden` 属性设为 `true`,即可隐藏该页面分组:
|
||
|
||
```json highlight={4}
|
||
"groups": [
|
||
{
|
||
"group": "快速开始",
|
||
"hidden": true,
|
||
"pages": [
|
||
"index",
|
||
"quickstart"
|
||
]
|
||
},
|
||
{
|
||
"group": "指南",
|
||
"pages": [
|
||
"guides/hidden-page.mdx",
|
||
"guides/hidden-groups.mdx"
|
||
]
|
||
}
|
||
]
|
||
```
|
||
|
||
在此示例中,`Getting started` 组被隐藏,而 `Guides` 组可见。
|
||
|
||
<div id="hiding-a-tab">
|
||
### 隐藏标签页
|
||
</div>
|
||
|
||
也可以在 `docs.json` 文件中添加 `hidden` 属性来隐藏某个标签页:
|
||
|
||
```json highlight={4}
|
||
"tabs": [
|
||
{
|
||
"tab": "首页",
|
||
"hidden": true,
|
||
"pages": [
|
||
"index",
|
||
"quickstart"
|
||
]
|
||
}
|
||
]
|
||
```
|
||
|
||
<div id="search-seo-and-ai-indexing">
|
||
## 搜索、SEO 与 AI 索引编入
|
||
</div>
|
||
|
||
默认情况下,隐藏页面不会被纳入搜索引擎的索引、文档站点的内部搜索,也不会作为 AI 助手的上下文使用。若要在搜索结果中包含隐藏页面并将其作为 AI 助手的上下文,请在你的 `docs.json` 中添加 `seo` 属性:
|
||
|
||
```json
|
||
"seo": {
|
||
"indexing": "all"
|
||
}
|
||
```
|
||
|
||
要排除某个特定页面,请在其 frontmatter 中添加 `noindex: true`。
|