Skip to content

Commit 57a1085

Browse files
authored
Merge pull request #42420 from bzsuni/contribute/style/hugo-shortcodes/index
[zh-cn] sync contribute/style/hugo-shortcodes/index.md
2 parents 3ad65f0 + 679d971 commit 57a1085

File tree

1 file changed

+17
-9
lines changed
  • content/zh-cn/docs/contribute/style/hugo-shortcodes

1 file changed

+17
-9
lines changed

content/zh-cn/docs/contribute/style/hugo-shortcodes/index.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,14 @@ Renders to:
449449
{{< /tabs >}}
450450

451451
<!--
452-
### Source code files
453-
You can use the `{{</* codenew */>}}` shortcode to embed the contents of file
452+
## Source code files
453+
You can use the `{{</* code */>}}` shortcode to embed the contents of file
454454
in a code block to allow users to download or copy its content to their clipboard.
455455
This shortcode is used when the contents of the sample file is generic and reusable,
456456
and you want the users to try it out themselves.
457457
-->
458-
你可以使用 `{{</* codenew */>}}` 短代码将文件内容嵌入代码块中,
458+
## 源代码文件
459+
你可以使用 `{{</* code */>}}` 短代码将文件内容嵌入代码块中,
459460
以允许用户下载或复制其内容到他们的剪贴板。
460461
当示例文件的内容是通用的、可复用的,并且希望用户自己尝试使用示例文件时,
461462
可以使用此短代码。
@@ -475,36 +476,43 @@ For example:
475476
如果未提供 `language` 参数,短代码将尝试根据文件扩展名推测编程语言。
476477

477478
```none
478-
{{</* codenew language="yaml" file="application/deployment-scale.yaml" */>}}
479+
{{</* code language="yaml" file="application/deployment-scale.yaml" */>}}
479480
```
480481

481482
<!--
482483
The output is:
483484
-->
484485
输出是:
485486

486-
{{< codenew language="yaml" file="application/deployment-scale.yaml" >}}
487+
{{< code language="yaml" file="application/deployment-scale.yaml" >}}
487488

488489
<!--
489490
When adding a new sample file, such as a YAML file, create the file in one
490491
of the `<LANG>/examples/` subdirectories where `<LANG>` is the language for
491-
the page. In the markdown of your page, use the `codenew` shortcode:
492+
the page. In the markdown of your page, use the `code` shortcode:
492493
-->
493494
添加新的示例文件(例如 YAML 文件)时,在 `<LANG>/examples/`
494495
子目录之一中创建该文件,其中 `<LANG>` 是页面的语言。
495-
在你的页面的 markdown 文本中,使用 `codenew` 短代码:
496+
在你的页面的 markdown 文本中,使用 `code` 短代码:
496497

497498
```none
498-
{{</* codenew file="<RELATIVE-PATH>/example-yaml>" */>}}
499+
{{</* code file="<RELATIVE-PATH>/example-yaml>" */>}}
499500
```
500501

501502
其中 `<RELATIVE-PATH>` 是要包含的示例文件的路径,相对于 `examples` 目录。
502503
以下短代码引用位于 `/content/en/examples/configmap/configmaps.yaml` 的 YAML 文件。
503504

504505
```none
505-
{{</* codenew file="configmap/configmaps.yaml" */>}}
506+
{{</* code file="configmap/configmaps.yaml" */>}}
506507
```
507508

509+
<!--
510+
The legacy `{{%/* codenew */%}}` shortcode is being replaced by `{{%/* code */%}}`.
511+
Use `{{%/* code */%}}` in new documentation.
512+
-->
513+
传统的 `{{%/* codenew */%}}` 短代码将被替换为 `{{%/* code */%}}`
514+
在新文档中使用 `{{%/* code */%}}`
515+
508516
<!--
509517
## Third party content marker
510518
-->

0 commit comments

Comments
 (0)