[zh] sync linkchecker/README.md

pull/41629/head
windsonsea 2023-06-14 09:52:21 +08:00
parent 4a4e0dd285
commit 110485b008
2 changed files with 54 additions and 54 deletions

View File

@ -1,6 +1,6 @@
---
content_type: concept
title: 为 Kubernetes 文档出一份力
title: 为 K8s 文档出一份力
linktitle: 贡献
main_menu: true
no_list: true
@ -8,12 +8,11 @@ weight: 80
card:
name: contribute
weight: 10
title: 开始为 Kubernetes 做贡献
title: 开始为 K8s 做贡献
---
<!--
---
content_type: concept
title: Contribute to Kubernetes docs
title: Contribute to K8s docs
linktitle: Contribute
main_menu: true
no_list: true
@ -22,7 +21,6 @@ card:
name: contribute
weight: 10
title: Start contributing to K8s
---
-->
<!-- overview -->
@ -30,10 +28,10 @@ card:
<!--
*Kubernetes welcomes improvements from all contributors, new and experienced!*
-->
*Kubernetes 欢迎来自所有贡献者的改进,无论你是新人和有经验的贡献者!*
**Kubernetes 欢迎来自所有贡献者的改进,无论你是新人和有经验的贡献者!**
<!--
{{< note >}}
<!--
To learn more about contributing to Kubernetes in general, see the
[contributor documentation](https://www.kubernetes.dev/docs/).
@ -41,9 +39,7 @@ You can also read the
{{< glossary_tooltip text="CNCF" term_id="cncf" >}}
[page](https://contribute.cncf.io/contributors/projects/#kubernetes)
about contributing to Kubernetes.
{{< /note >}}
-->
{{< note >}}
要了解有关为 Kubernetes 做出贡献的更多信息,请参阅
[贡献者文档](https://www.kubernetes.dev/docs/)。
@ -88,7 +84,8 @@ to work effectively in the Kubernetes community.
任何人都可以提出文档方面的问题issue或贡献一个变更用拉取请求PR的方式提交到
[GitHub 上的 `kubernetes/website` 仓库](https://github.com/kubernetes/website)。
当然你需要熟练使用 [git](https://git-scm.com/) 和 [GitHub](https://lab.github.com/) 才能在 Kubernetes 社区中有效工作。
当然你需要熟练使用 [git](https://git-scm.com/) 和 [GitHub](https://lab.github.com/)
才能在 Kubernetes 社区中有效工作。
<!--
To get involved with documentation:
@ -104,7 +101,8 @@ To get involved with documentation:
1. 签署 CNCF 的[贡献者许可协议](https://github.com/kubernetes/community/blob/master/CLA.md)。
2. 熟悉[文档仓库](https://github.com/kubernetes/website)和网站的[静态站点生成器](https://gohugo.io)。
3. 确保理解[发起 PR](/zh-cn/docs/contribute/new-content/open-a-pr/) 和[审查变更](/zh-cn/docs/contribute/review/reviewing-prs/)的基本流程。
3. 确保理解[发起 PR](/zh-cn/docs/contribute/new-content/open-a-pr/)
和[审查变更](/zh-cn/docs/contribute/review/reviewing-prs/)的基本流程。
<!-- See https://github.com/kubernetes/website/issues/28808 for live-editor URL to this figure -->
<!-- You can also cut/paste the mermaid code into the live editor at https://mermaid-js.github.io/mermaid-live-editor to play around with it -->
@ -235,11 +233,11 @@ Figure 2. Preparation for your first contribution.
检索最适合作为切入点的问题。
- 在现有文档上,[使用 GitHub 提交 PR](/zh-cn/docs/contribute/new-content/open-a-pr/#changes-using-github)
掌握在 GitHub 上登记 Issue 的方法。
- Kubernetes 社区其他成员会[评审 PR ](/zh-cn/docs/contribute/review/reviewing-prs/)
- Kubernetes 社区其他成员会[评审 PR](/zh-cn/docs/contribute/review/reviewing-prs/)
以确保文档精准和语言流畅。
- 阅读 kubernetes 的[内容指南](/zh-cn/docs/contribute/style/content-guide/)和
[风格指南](/zh-cn/docs/contribute/style/style-guide/),以发表有见地的评论。
- 了解[页面内容类型](/zh-cn/docs/contribute/style/page-content-types/)和
- 了解[页面内容类型](/zh-cn/docs/contribute/style/page-content-types/)和
[Hugo 短代码](/zh-cn/docs/contribute/style/hugo-shortcodes/)。
<!--
@ -250,16 +248,16 @@ Figure 2. Preparation for your first contribution.
- Document [features in a release](/docs/contribute/new-content/new-features/).
- Participate in [SIG Docs](/docs/contribute/participate/), and become a
[member or reviewer](/docs/contribute/participate/roles-and-responsibilities/).
- Start or help with a [localization](/docs/contribute/localization/).
-->
## 下一步 {#next-teps}
- 学习在仓库的[本地克隆中工作](/zh-cn/docs/contribute/new-content/open-a-pr/#fork-the-repo)。
- 为[发行版的特性](/zh-cn/docs/contribute/new-content/new-features/)编写文档。
- 加入 [SIG Docs](/zh-cn/docs/contribute/participate/)并成为[成员或评审者](/zh-cn/docs/contribute/participate/roles-and-responsibilities/)。
- 开始或帮助[本地化](/zh-cn/docs/contribute/localization/) 工作。
- 加入 [SIG Docs](/zh-cn/docs/contribute/participate/)
并成为[成员或评审者](/zh-cn/docs/contribute/participate/roles-and-responsibilities/)。
- 开始或帮助[本地化](/zh-cn/docs/contribute/localization/)工作。
<!--
## Get involved with SIG Docs
@ -277,6 +275,7 @@ SIG Docs communicates with different methods:
参与 SIG Docs 是 Kubernetes 贡献者(开发者和其他人员)对 Kubernetes 项目产生重大影响力的好方式。
SIG Docs 的几种沟通方式:
<!--
- [Join `#sig-docs` on the Kubernetes Slack instance](https://slack.k8s.io/). Make sure to
introduce yourself!
@ -285,9 +284,9 @@ SIG Docs 的几种沟通方式:
- Join the [SIG Docs video meeting](https://github.com/kubernetes/community/tree/master/sig-docs) held every two weeks. Meetings are always announced on `#sig-docs` and added to the [Kubernetes community meetings calendar](https://calendar.google.com/calendar/embed?src=cgnt364vd8s86hr2phapfjc6uk%40group.calendar.google.com&ctz=America/Los_Angeles). You'll need to download the [Zoom client](https://zoom.us/download) or dial in using a phone.
- Join the SIG Docs async Slack standup meeting on those weeks when the in-person Zoom video meeting does not take place. Meetings are always announced on `#sig-docs`. You can contribute to any one of the threads up to 24 hours after meeting announcement.
-->
- [加入 Kubernetes 在 Slack 上的`#sig-docs` 频道](https://slack.k8s.io/)。
- [加入 Kubernetes 在 Slack 上的 `#sig-docs` 频道](https://slack.k8s.io/)。
一定记得自我介绍!
- [加入 `kubernetes-sig-docs` 邮件列表](https://groups.google.com/forum/#!forum/kubernetes-sig-docs),
- [加入 `kubernetes-sig-docs` 邮件列表](https://groups.google.com/forum/#!forum/kubernetes-sig-docs)
这里有更广泛的讨论,和官方决策的记录。
- 参加每两周召开一次的 [SIG Docs 视频会议](https://github.com/kubernetes/community/tree/master/sig-docs)。
会议总是在 `#sig-docs` 上发出公告,同时添加到

View File

@ -1,24 +1,24 @@
<!--
# Internal link checking tool
-->
-->
# 内置链接检查工具
<!--
You can use [htmltest](https://github.com/wjdp/htmltest) to check for broken links in [`/content/en/`](https://git.k8s.io/website/content/en/). This is useful when refactoring sections of content, moving pages around, or renaming files or page headers.
-->
-->
你可以使用 [htmltest](https://github.com/wjdp/htmltest) 来检查
[`/content/en/`](https://git.k8s.io/website/content/en/) 下面的失效链接。
这在重构章节内容、移动页面或者重命名文件或页眉时非常有用。
<!--
## How the tool works
-->
## 工作原理
-->
## 工作原理 {#how-the-tool-works}
<!--
`htmltest` scans links in the generated HTML files of the kubernetes website repository. It runs using a `make` command which does the following:
-->
`htmltest` 会扫描 kubernetes website 仓库构建生成的 HTML 文件。通过执行 `make` 命令进行了下列操作:
-->
`htmltest` 会扫描 Kubernetes website 仓库构建生成的 HTML 文件。通过执行 `make` 命令进行了下列操作:
<!--
- Builds the site and generates output HTML in the `/public` directory of your local `kubernetes/website` repository
@ -33,15 +33,15 @@ You can use [htmltest](https://github.com/wjdp/htmltest) to check for broken lin
<!--
## What it does and doesn't check
-->
## 哪些链接不会检查
-->
## 哪些链接不会检查 {#what-it-does-and-doesnot-check}
<!--
The link checker scans generated HTML files, not raw Markdown. The htmltest tool depends on a configuration file, [`.htmltest.yml`](https://git.k8s.io/website/.htmltest.yml), to determine which content to examine.
The link checker scans the following:
-->
该链接检查器扫描生成的 HTML 文件,而非原始的 Markdown. 该 htmltest 工具依赖于配置文件
-->
该链接检查器扫描生成的 HTML 文件,而非原始的 Markdown该 htmltest 工具依赖于配置文件
[`.htmltest.yml`](https://git.k8s.io/website/.htmltest.yml),来决定检查哪些内容。
该链接检查器扫描以下内容:
@ -52,16 +52,17 @@ The link checker scans the following:
- All internal links, excluding:
- Empty hashes (`<a href="#">` or `[title](#)`) and empty hrefs (`<a href="">` or `[title]()`)
- Internal links to images and other media files
-->
- 所有由 [`/content/en/docs`](https://git.k8s.io/website/content/en/docs/) 目录下的 Markdown 文件生成的内容,但不包括:
-->
- 所有由 [`/content/en/docs`](https://git.k8s.io/website/content/en/docs/)
目录下的 Markdown 文件生成的内容,但不包括:
- 生成的 API 参考,例如 https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/
- 所有的内部链接,但不包括:
- 空白锚点 (`<a href="#">` 或 `[title](#)`) 以及空白目标地址 (`<a href="">` 或 `[title]()`)
- 空白锚点 (`<a href="#">` 或 `[title](#)`) 以及空白目标地址 (`<a href="">` 或 `[title]()`)
- 指向图片或其他媒体文件的内部链接
<!--
The link checker does not scan the following:
-->
-->
该链接检查器不会扫描以下内容:
<!--
@ -70,7 +71,7 @@ The link checker does not scan the following:
- Blog posts
- API Reference documentation, for example: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/
- Localizations
-->
-->
- 包含在顶部和侧边导航栏的链接,以及页脚链接或者页面的 `<head>` 部分中的链接,例如 CSS 样式表、脚本以及元信息的链接。
- 顶级页面及其子页面,例如:`/training`、`/community`、`/case-studies/adidas`
- 博客文章
@ -79,47 +80,47 @@ The link checker does not scan the following:
<!--
## Prerequisites and installation
-->
## 先决条件以及安装说明
-->
## 先决条件以及安装说明 {#prerequisites-and-installation}
<!--
You must install
-->
-->
必须安装:
* [Docker](https://docs.docker.com/get-docker/)
* [make](https://www.gnu.org/software/make/)
<!--
## Running the link checker
-->
## 运行链接检查器
-->
## 运行链接检查器 {#running-link-checker}
<!--
To run the link checker:
-->
-->
运行链接检查器需要:
<!--
1. Navigate to the root directory of your local `kubernetes/website` repository.
2. Run the following command:
-->
-->
1. 进入本地 `kubernetes/website` 仓库的根目录下。
2. 执行如下命令:
```
make container-internal-linkcheck
```
```
make container-internal-linkcheck
```
<!--
## Understanding the output
-->
## 理解输出的内容
-->
## 理解输出的内容 {#understanding-output}
<!--
If the link checker finds broken links, the output is similar to the following:
-->
-->
如果链接检查器发现了失效链接,则输出内容类似如下:
```
@ -138,12 +139,12 @@ The tool gives a reason: `hash does not exist`. In most cases, you can ignore th
The target URL is `#preserving-unknown-fields`.
One way to fix this is to:
-->
-->
这是一系列失效链接。该日志附带了每个页面下的失效链接。
在这部分输出中,包含失效链接的文件是 `tasks/access-kubernetes-api/custom-resources.md`
该工具给出了一个理由:`hash does not exist`在大部分情况下,你可以忽略这个。
该工具给出了一个理由:`hash does not exist`在大部分情况下,你可以忽略这个。
目标链接是 `#preserving-unknown-fields`
@ -153,12 +154,12 @@ One way to fix this is to:
1. Navigate to the Markdown file with a broken link.
2. Using a text editor, do a full-text search (usually Ctrl+F or Command+F) for the broken link's URL, `#preserving-unknown-fields`.
3. Fix the link. For a broken page hash (or _anchor_) link, check whether the topic was renamed or removed.
-->
-->
1. 转到含有失效链接的 Markdown 文件。
2. 使用文本编辑器全文搜索失效链接的 URL通常使用 Ctrl+F 或 Command+F`#preserving-unknown-fields`.
3. 修复该链接。对于一个失效的锚点(或者 _anchor_ )链接,检查该主题是否已更名或者移除。
2. 使用文本编辑器全文搜索失效链接的 URL通常使用 Ctrl+F 或 Command+F`#preserving-unknown-fields`
3. 修复该链接。对于一个失效的锚点(或者 **anchor**)链接,检查该主题是否已更名或者移除。
<!--
Run htmltest to verify that broken links are fixed.
-->
运行 htmltest 来验证失效链接是否已修复。
-->
运行 htmltest 来验证失效链接是否已修复。