Эх сурвалжийг харах

Translate guides-navigation

DemoPark 8 жил өмнө
parent
commit
356ad60287
1 өөрчлөгдсөн 42 нэмэгдсэн , 45 устгасан
  1. 42 45
      docs/guides-navigation.md

+ 42 - 45
docs/guides-navigation.md

@@ -1,52 +1,49 @@
----
-id: navigation
-title: Navigation and Sidebars
----
+# 导航和侧边栏
 
-## Referencing Site Documents
+## 引用网站文档
 
-If you want to reference another document in your `docs` folder (or the location you set via the [optional `customDocsPath`](https://docusaurus.io/docs/en/site-config.html#optional-fields) path site configuration option), then you just use the name of the document you want to reference.
+如果你想在 `docs` 文件夹中引用另一个文档(或者你通过[可选 `customDocsPath`](api-site-config.md#可选字段)路径站点配置选项设置的位置),那么你只需要使用你想引用的文档名称。
 
-For example, if you are in `doc2.md` and you want to reference `doc1.md`:
+例如,如果你在 `doc2.md` 中,而你想引用 `doc1.md`:
 
 ```
-I am referencing a [document](doc1.md).
+这里引用了一个 [文档](doc1.md).
 ```
 
-> Docusaurus currently does not support documents in nested folders; only in a flatfile structure. We are looking into adding support for nested folders.
+> Docusaurus 目前不支持嵌套文件夹中的文件; 只能是在一个平面文件结构中。 我们正在考虑添加对嵌套文件夹的支持。
 
-## How Documents are Linked
+## 文档如何链接
 
-New markdown files within `docs` will show up as pages on the website. Links to those documents are created first by using the `id` in the header of each document. If there is no `id` field, then the name of the file will serve as the link name.
+`docs` 中的新 markdown 文件将在网站上显示为页面。 这些文档的链接首先通过在每个文档的头部使用 `id` 来创建。 如果没有 `id` 字段,那么文件的名称将作为链接名称。
 
-For example, creating an empty file such as "docs/getting-started.md" will enable the new page URL as `/docs/getting-started.html`.
+例如,创建诸如 "docs/getting-started.md" 之类的空文件将使新页面 URL 成为 `/docs/getting-started.html`。
 
-Suppose you add this to your document:
+假设您将其添加到您的文档中:
 
 ```
 ---
 id: intro
-title: Getting Started
+title: 入门
 ---
 
-My *new content* here..
+这是文档的 *新内容*...
 ```
 
-If you set the `id` field in the markdown header of the file, the doc will then be accessed from a URL of the form `/docs/intro.html`.
+如果您在文件的标记标题中设置了 `id` 字段,那么文档将从 `/docs/intro.html` 形式的 URL 访问。
 
-> You need an `id` field to be able to add the document to the sidebar.
+> 您需要一个 `id` 字段才能将文档添加到侧边栏。
 
-## Adding Documents to a Sidebar
+## 添加文档到侧边栏
 
-Many times, you will want to add a document to a sidebar that will be associated with one of the headers in the top navigation bar of the website. The most common sidebar, and the one that comes installed when Docusaurus is initialized, is the `docs` sidebar.
+很多时候,您将需要添加一个文档到侧边栏,这个侧边栏将与网站顶部导航栏中的一个标题相关联。 最常见的补充工具栏,以及在 Docusaurus 初始化时安装的工具栏是 `docs` 工具栏。
 
-> "docs" is just a name. It has no inherit meaning. You can change it as you wish.
+> "docs" 只是一个名字。 它没有继承的意义。 你可以随意更改。
 
-You configure the contents of the sidebar, and the order of its documents, in the `website/sidebars.json` file.
+您可以在 `website/sidebars.json` 文件中配置侧边栏的内容以及文档的顺序。
 
-> Until you add your document to `website/sidebars.json`, they will only be accessible via a direct URL. The doc will not show up in any sidebar.
+> 在将文档添加到 `website/sidebars.json` 之前,只能通过直接的URL访问它们。 该文档不会显示在任何侧边栏。
 
-Within `sidebars.json`, add the `id` you used in the document header to existing sidebar/category. In the below case, `docs` is the name of the sidebar and `Getting Started` is a category within the sidebar.
+在 `sidebars.json` 中,将在文档头中使用的 `id` 添加到现有的侧边栏/类别中。 在下面的情况下,`docs` 是侧边栏的名称,`Getting Started` 是侧边栏中的一个类别。
 
 ```
 {
@@ -55,7 +52,7 @@ Within `sidebars.json`, add the `id` you used in the document header to existing
       "getting-started"
 ```
 
-Or you can create a new category within the sidebar:
+或者你可以在侧边栏中创建一个新的类别:
 
 ```
 {
@@ -67,9 +64,9 @@ Or you can create a new category within the sidebar:
     ...
 ```
 
-### Adding New Sidebars
+### 添加新侧边栏
 
-You can also put a document in a new sidebar. In the following example, we are creating an `examples-sidebar` sidebar within `sidebars.json` that has a category called `My Example Category` containing a document with an `id` of `my-examples`.
+您也可以将文档放在新的侧边栏中。 在下面的例子中,我们在 `sidebars.json` 里面创建一个名为 `My Example Category` 的类别为 `examples-sidebar` 的工具栏,里面包含一个 `id` 为 `my-examples` 的文档。
 
 ```
 {
@@ -81,15 +78,15 @@ You can also put a document in a new sidebar. In the following example, we are c
   ...
 ```
 
-It is important to note that until you [add a document from the `"examples-sidebar"` sidebar to the nav bar](#additions-to-the-site-navigation-bar), it will be hidden.
+重要的是要注意,直到你[从 `"example-sidebar"` 侧边栏添加一个文档到导航栏](#添加到网站导航栏),它将会被隐藏。
 
-## Additions to the Site Navigation Bar
+## 添加到网站导航栏
 
-To expose sidebars, you will add clickable labels to the site navigation bar at the top of the website. You can add documents, pages and external links.
+要展开侧边栏,您需要将可点击的标签添加到网站顶部的网站导航栏中。 您可以添加文档,页面和外部链接。
 
-### Adding Documents
+### 添加文档
 
-After creating a new sidebar for the site by [adding](#adding-new-sidebars) it to `sidebars.json`, you can expose the new sidebar from the top navigation bar by editing the `headerLinks` field of `siteConfig.js`.
+通过将其[添加](#添加新侧边栏)到 `sidebars.json`,为该网站创建一个新的侧边栏后,您可以通过编辑 `siteConfig.js` 的 `headerLinks` 字段来从顶部导航栏中展开新的侧边栏。
 
 ```
 headerLinks: [
@@ -99,11 +96,11 @@ headerLinks: [
 ],
 ```
 
-A label called `Examples` will be added to the site navigation bar and when you click on it at the top of your site, the `examples-sidebar` will be shown and the default document will be `my-examples`.
+一个名为 `Examples` 的标签将被添加到网站导航栏中,当您在网站顶部点击它时,将会显示 `examples-sidebar`,默认文档将是 `my-examples`。
 
-### Adding Custom Pages
+### 添加自定义页面
 
-To add custom pages to the site navigation bar, entries can be added to the `headerLinks` of `siteConfig.js`. For example, if we have a page within `website/pages/help.js`, we can link to it by adding the following:
+要将自定义页面添加到网站导航栏,可将条目添加到 `siteConfig.js` 的 `headerLinks` 中。 例如,如果我们在 `website/pages/help.js` 中有一个页面,我们可以通过添加以下内容来链接到它:
 
 ```
 headerLinks: [
@@ -113,11 +110,11 @@ headerLinks: [
 ],
 ```
 
-A label called `Help` will be added to the site navigation bar and when you click on it at the top of your site, the content from the `help.js` page will be shown.
+一个名为 `Help` 的标签将被添加到站点导航栏中,当您在站点顶部点击它时,将显示 `help.js` 页面的内容。
 
-### Adding External Links
+### 添加外部链接
 
-Custom links can be added to the site navigation bar with the following entry in `siteConfig.js`:
+自定义链接可以通过 `siteConfig.js` 中的以下条目添加到网站导航栏中:
 
 ```
 headerLinks: [
@@ -127,17 +124,17 @@ headerLinks: [
 ],
 ```
 
-A label called `GitHub` will be added to the site navigation bar and when you click on it at the top of your site, the content of the external link will be shown.
+一个名为 `GitHub` 的标签将被添加到站点导航栏中,当您在站点顶部点击它时,外部链接的内容将被显示。
 
-> To open external links in a new tab, provide an `external: true` flag within the header link config.
+> 要在新选项卡中打开外部链接,请在标题链接配置中提供一个 `external: true` 标志。
 
-## Site Navigation Bar Positioning
+## 网站导航栏定位
 
-You have limited control where the search and languages dropdown elements are shown in the site navigation bar at the top of your website.
+在网站顶部的网站导航栏中显示搜索和语言下拉列表元素时,您的控制权限有限。
 
-### Search
+### 搜索
 
-If search is enabled on your site, your search bar will appear to the right of your links. If you want to put the search bar between links in the header, add a search entry in the `headerLinks` config array:
+如果在您的网站上启用搜索,您的搜索栏将显示在您的链接的右侧。 如果您想要在搜索栏中的链接之间添加一个搜索条目,在 `headerLinks` 配置数组中:
 
 ```
 headerLinks: [
@@ -147,9 +144,9 @@ headerLinks: [
 ],
 ```
 
-### Languages Dropdown
+### 语言下拉菜单
 
-If translations is enabled on your site, the language dropdown will appear to the right of your links (and to the left of the search bar, if search is enabled). If you want to put the language selection drop down between links in the header, add a languages entry in the `headerLinks` config array:
+如果在您的网站上启用了翻译,则语言下拉菜单将显示在您的链接的右侧(如果启用搜索,则会显示在搜索栏的左侧)。 如果要将语言选择放在标题中的链接之间,请在 `headerLinks` 配置数组中添加一个语言条目:
 
 ```
 headerLinks: [