Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new guideline about adding external link hint #8

Merged
merged 3 commits into from
Oct 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions source/文档内容元素/链接.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ Markdown 链接中方括号 () 里的内容即为该链接的路径。链接的
- 链接路径应尽量统一风格。例如,链接至非外部站点时应统一使用相对路径或绝对路径,不建议混用相对路径和绝对路径。

- 建议减少将用户链至外部站点的次数,以免外部站点的页面失效而影响用户体验。

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,你想帮忙 review 下这一段 guideline 吗?@oldLady344

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我先合了,上线看看效果,如果有问题可以再提 PR,谢谢~

> 外部站点的含义:A 网站的文档中出现了一个 B 链接,如果 B 与 A 的域名或服务器不一样,则对于 A 网站的文档来说,B 链接为外部站点。例如:cloud.google.com 相对于 support.google.com 为内部站点;cloud.google.com 相对于 kubernetes.io 为外部站点。

- **如果必须将用户链至外部站点,建议在该外链后加上明显的标示,提醒用户该链接将前往外部站点。**

> 由于不同网站的使用条款和隐私政策不同,用户使用当前站点,一般默认用户已经接受了当前站点的法律条文。跳出当前站点之前,网站维护者有责任提醒用户当前的链接是去往外部站点,跳出去之后如果用户发生问题,不是当前站点的责任。

- 【示例一】如果前端能力足够,可以在外链后加上通用的外链 icon 效果,比如:[贡献者名单](https://github.com/yikeke/zh-style-guide/graphs/contributors)。

- 【示例二】在 Markdown 中,可以简单在链接的路径后加上 `"点击前往外部站点"` 或者 `"点击前往 XXX 网站"`等信息,如 `[链接的描述](链接的路径 "前往外部链接的提示")`,即可在正常渲染下,实现鼠标悬停在超链接上时出现提示的效果。