Skip to content

Commit a9ecd7a

Browse files
committed
docs: 更新文档以支持中文翻译
- 更新设置页脚、设置标题、版本控制、基础博客教程等文档 - 添加中文翻译并调整格式以适应 MkDocs 材料主题 - 补充示例和说明以提高文档的可读性和实用性
1 parent ee51070 commit a9ecd7a

6 files changed

Lines changed: 619 additions & 619 deletions

File tree

docs/setup/setting-up-the-footer.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# Setting up the footer
1+
# 设置页脚
22

3-
The footer of your project documentation is a great place to add links to
4-
websites or platforms you or your company are using as additional marketing
5-
channels, e.g. :fontawesome-brands-mastodon:{ style="color: #5A4CE0" } or
6-
:fontawesome-brands-youtube:{ style="color: #EE0F0F" }, which you can easily
7-
configure via `mkdocs.yml`.
3+
项目文档的页脚是添加链接的好地方
4+
您或您的公司用作额外营销的网站或平台
5+
渠道,例如:fontawesome品牌乳齿象:{ style="color: #5A4CE0" }
6+
fontawesome brands youtube:{ style="color: #EE0F0F" },您可以轻松访问
7+
通过`mkdocs.yml`进行配置。
88

9-
## Configuration
9+
## 配置
1010

11-
### Navigation
11+
### 导航
1212

1313
<!-- md:version 9.0.0 -->
1414
<!-- md:feature -->
1515

16-
The footer can include links to the previous and next page of the current page.
17-
If you wish to enable this behavior, add the following lines to `mkdocs.yml`:
16+
页脚可以包含指向当前页面上一页和下一页的链接。
17+
如果要启用此行为,请在`mkdocs.yml`中添加以下行:
1818

1919
``` yaml
2020
theme:
2121
features:
2222
- navigation.footer
2323
```
2424
25-
### Social links
25+
### 社交链接
2626
2727
<!-- md:version 1.0.0 -->
2828
<!-- md:default none -->
2929
30-
Social links are rendered next to the copyright notice as part of the
31-
footer of your project documentation. Add a list of social links in `mkdocs.yml`
32-
with:
30+
社交链接作为版权声明的一部分显示在版权声明旁边
31+
项目文档的页脚。在`mkdocs.yml`中添加社交链接列表
32+
与:
3333

3434
``` yaml
3535
extra:
@@ -38,8 +38,8 @@ extra:
3838
link: https://fosstodon.org/@squidfunk
3939
```
4040

41-
1. Enter a few keywords to find the perfect icon using our [icon search] and
42-
click on the shortcode to copy it to your clipboard:
41+
1. 输入几个关键字,使用我们的[图标搜索]找到完美的图标,然后
42+
单击短代码将其复制到剪贴板:
4343

4444
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
4545
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="mastodon" />
@@ -49,13 +49,13 @@ extra:
4949
</div>
5050
</div>
5151

52-
The following properties are available for each link:
52+
每个链接都有以下属性:
5353

5454
<!-- md:option social.icon -->
5555

5656
: <!-- md:default none --> <!-- md:flag required -->
57-
This property must contain a valid path to any icon bundled with the theme,
58-
or the build will not succeed. Some popular choices:
57+
此属性必须包含指向与主题绑定的任何图标的有效路径,
58+
否则构建将不会成功。一些流行的选择:
5959

6060
* :fontawesome-brands-github: – `fontawesome/brands/github`
6161
* :fontawesome-brands-gitlab: – `fontawesome/brands/gitlab`
@@ -73,8 +73,8 @@ The following properties are available for each link:
7373
<!-- md:option social.link -->
7474

7575
: <!-- md:default none --> <!-- md:flag required -->
76-
This property must be set to a relative or absolute URL including the URI
77-
scheme. All URI schemes are supported, including `mailto` and `bitcoin`:
76+
此属性必须设置为包含URI的相对或绝对URL
77+
方案。支持所有URI方案,包括“mailto”和“bitcoin”:
7878

7979
=== ":fontawesome-brands-mastodon: Mastodon"
8080

@@ -97,8 +97,8 @@ The following properties are available for each link:
9797
<!-- md:option social.name -->
9898

9999
: <!-- md:default _domain name from_ `link`_, if available_ -->
100-
This property is used as the link's `title` attribute and can be set to a
101-
discernable name to improve accessibility:
100+
此属性用作链接的“title”属性,可以设置为
101+
可辨别的名称,以提高可访问性:
102102

103103
``` yaml
104104
extra:
@@ -111,54 +111,54 @@ The following properties are available for each link:
111111
[icon search]: ../reference/icons-emojis.md#search
112112
[rel=me]: https://docs.joinmastodon.org/user/profile/#verification
113113

114-
### Copyright notice
114+
### 版权声明
115115

116116
<!-- md:version 0.1.0 -->
117117
<!-- md:default none -->
118118

119-
A custom copyright banner can be rendered as part of the footer, which is
120-
displayed next to the social links. It can be defined as part of `mkdocs.yml`:
119+
自定义版权横幅可以作为页脚的一部分呈现,即
120+
显示在社交链接旁边。它可以被定义为“mkdocs.yml”的一部分:
121121

122122
``` yaml
123123
copyright: Copyright &copy; 2016 - 2020 Martin Donath
124124
```
125125

126-
### Generator notice
126+
### 发电机通知
127127

128128
<!-- md:version 7.3.0 -->
129129
<!-- md:default `true` -->
130130

131-
The footer displays a _Made with Material for MkDocs_ notice to denote how
132-
the site was generated. The notice can be removed with the following option
133-
via `mkdocs.yml`:
131+
页脚显示了一个_Made with Material for MkDocs_通知,表示如何
132+
该网站已生成。可以通过以下选项删除通知
133+
通过`mkdocs.yml`
134134

135135
``` yaml
136136
extra:
137137
generator: false
138138
```
139139

140-
!!! info "Please read this before removing the generator notice"
140+
!!! info "请在删除发电机通知之前阅读此内容"
141141

142-
The subtle __Made with Material for MkDocs__ hint in the footer is one of
143-
the reasons why this project is so popular, as it tells the user how the
144-
site is generated, helping new users to discover this project. Before
145-
removing please consider that you're enjoying the benefits of @squidfunk's
146-
work for free, as this project is Open Source and has a permissive license.
147-
Thousands of hours went into this project, most of them
148-
without any financial return.
142+
页脚中微妙的__Made with Material for MkDocs__提示是
143+
这个项目如此受欢迎的原因,因为它告诉用户
144+
生成网站,帮助新用户发现此项目。之前
145+
删除请考虑您正在享受@squidfunk的好处
146+
免费工作,因为这个项目是开源的,有许可证。
147+
这个项目花了数千个小时,其中大部分
148+
没有任何经济回报。
149149

150150
Thus, if you remove this notice, please consider [sponsoring][Insiders] the
151151
project. __Thank you__ :octicons-heart-fill-24:{ .mdx-heart .mdx-insiders }
152152

153153
[Insiders]: ../insiders/index.md
154154

155-
## Usage
155+
## 使用
156156

157-
### Hiding prev/next links
157+
### 隐藏上一页/下一页链接
158158

159-
The footer navigation showing links to the previous and next page can be hidden
160-
with the front matter `hide` property. Add the following lines at the top of a
161-
Markdown file:
159+
显示上一页和下一页链接的页脚导航可以隐藏
160+
具有前体“隐藏”属性。在a的顶部添加以下行
161+
Markdown文件:
162162

163163
``` yaml
164164
---
@@ -170,9 +170,9 @@ hide:
170170
...
171171
```
172172

173-
## Customization
173+
## 自定义
174174

175-
### Custom copyright
175+
### 自定义版权
176176

177177
<!-- md:version 8.0.0 -->
178178
<!-- md:flag customization -->

docs/setup/setting-up-the-header.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
# Setting up the header
1+
# 设置标题
22

3-
Material for MkDocs' header can be customized to show an announcement bar that
4-
disappears upon scrolling, and provides some options for further configuration.
5-
It also includes the [search bar] and a place to display your project's
6-
[git repository], as explained in those dedicated guides.
3+
Material for MkDocs标题可以定制,以显示公告栏
4+
滚动时消失,并提供一些进一步配置的选项。
5+
它还包括[search bar]和一个显示项目的位置
6+
[git repository],如这些专门指南中所解释的。
77

88
[search bar]: setting-up-site-search.md
99
[git repository]: adding-a-git-repository.md
1010

11-
## Configuration
11+
## 配置
1212

13-
### Automatic hiding
13+
### 自动隐藏
1414

1515
<!-- md:version 6.2.0 -->
1616
<!-- md:feature -->
1717

18-
When autohiding is enabled, the header is automatically hidden when the
19-
user scrolls past a certain threshold, leaving more space for content. Add the
20-
following lines to `mkdocs.yml`:
18+
启用自动隐藏后,当
19+
用户滚动超过某个阈值,为内容留下更多空间。添加
20+
将以下行转换为`mkdocs.yml`
2121

2222
``` yaml
2323
theme:
2424
features:
2525
- header.autohide
2626
```
2727
28-
### Announcement bar
28+
### 公告栏
2929
3030
<!-- md:version 5.0.0 -->
3131
<!-- md:flag customization -->
3232
33-
Material for MkDocs includes an announcement bar, which is the perfect place to
34-
display project news or other important information to the user. When the user
35-
scrolls past the header, the bar will automatically disappear. In order to add
36-
an announcement bar, [extend the theme] and [override the `announce`
37-
block][overriding blocks], which is empty by default:
33+
MkDocs的材料包括一个公告栏,这是一个完美的地方
34+
向用户显示项目新闻或其他重要信息。当用户
35+
滚动过标题,栏将自动消失。为了添加
36+
公告栏,[extend the theme][override the `announce`
37+
block][overriding blocks],默认为空:
3838

3939
``` html
4040
{% extends "base.html" %}
@@ -47,25 +47,25 @@ block][overriding blocks], which is empty by default:
4747
[extend the theme]: ../customization.md#extending-the-theme
4848
[overriding blocks]: ../customization.md#overriding-blocks
4949

50-
#### Mark as read
50+
#### 标记为已读
5151

5252
<!-- md:version 8.4.0 -->
5353
<!-- md:feature -->
5454
<!-- md:flag experimental -->
5555

56-
In order to render temporary announcements that can be marked as read by the
57-
user, a button to dismiss the current announcement can be included. Add the
58-
following lines to `mkdocs.yml`:
56+
为了呈现可标记为已阅读的临时公告
57+
用户,可以包括一个按钮来取消当前的公告。添加
58+
将以下行转换为`mkdocs.yml`
5959

6060
``` yaml
6161
theme:
6262
features:
6363
- announce.dismiss
6464
```
6565

66-
When the user clicks the button, the current announcement is dismissed and not
67-
displayed again until the content of the announcement changes. This is handled
68-
automatically.
66+
当用户点击按钮时,当前公告将被取消,不会
67+
再次显示,直到公告的内容发生变化。这已经处理好了
68+
自动。
6969

7070
[Scroll to the top of this page][top] to see it in action.
7171

0 commit comments

Comments
 (0)