Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Update tags.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TKanX committed Feb 5, 2024
1 parent 10e5b0b commit 83124ed
Showing 1 changed file with 95 additions and 93 deletions.
188 changes: 95 additions & 93 deletions docs/en/guide/tags.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,68 @@
# 文章内嵌标签
# Article embedded tags

:::tip
以下修改内容放在文章中,如 `/source/_posts/foo.md`
Place the modified content in the article, such as `/source/_posts/foo.md`
:::

## MD 标签
## MD tags

## Front-matter

- `title`:文章标题。
- `date`:文章发布时间。
- `comment`:是否关闭文章评论。
- `sticky`:当设置为 `true` 时此篇文章置顶,如果置顶多篇文章按照发布时间倒序排列,不分页。
- `tags`:文章标签。
- `cover`:文章轮播图(覆盖全局)文章封面。
- `audio`:文章背景音乐(覆盖全局),当设置为 `false` 时关闭背景音乐。
- `title`: Article title.
- `date`: Article publication date.
- `comment`: Whether to disable comments for the article.
- `sticky`: When set to `true`, the article will be pinned. If multiple articles are pinned, they will be displayed in reverse chronological order without pagination.
- `tags`: Article tags.
- `cover`: Article carousel image (overrides global settings) and article cover image.
- `audio`: Article background music (overrides global settings). Set to `false` to disable background music.

:::tip
修改内容应该放在代码围栏(形如 `---` )中,如:
The modified content should be placed within code fences (e.g., `---`), like this:

``` markdown
````markdown
---
title: foo
tags:
- bar
- baz
- bar
- baz
audio: false
---

:::

```yaml
title: 文章标题
date: 文章发布的时间
comment: false # true/false对应开启/关闭本文章评论
sticky : true # 置顶文章
title: Article Title
date: Article Publication Date
comment: false # true/false to enable/disable comments for this article
sticky : true # Pin the article
tags:
- 文章标签1
- 文章标签2
- Article Tag 1
- Article Tag 2
categories:
- [计算机科学, Linux]
cover: cover.png # 文章顶部和文章介绍图(将覆盖文章主页轮播图)
- [Computer Science, Linux]
cover: cover.png # Article header and preview image (overrides homepage carousel)
audio:
- https://music.163.com/song?id=1387098940
audio: false
```
````

### 数学公式(KaTeX
### Mathematical Formulas (KaTeX)

使用 [KaTeX](https://katex.org/) 在文章内添加数学公式,需要在 Front-matter 中添加 `math: true`
To add mathematical formulas using [KaTeX](https://katex.org/) in your article, you need to add `math: true` in the Front-matter:

```markdown
---
title: 数学公式显示
title: Displaying Mathematical Formulas
math: true
---

行内公式:$\sqrt {3x-1}+(1+x)^2$
Inline formula: $\sqrt {3x-1}+(1+x)^2$

独立块显示:
$$\begin {array}{c}
Display as a standalone block:

$$
\begin {array}{c}

\nabla \times \vec {\mathbf {B}} -\, \frac1c\, \frac {\partial\vec {\mathbf {E}}}{\partial t} &
= \frac {4\pi}{c}\vec {\mathbf {j}} \nabla \cdot \vec {\mathbf {E}} & = 4 \pi \rho \\
Expand All @@ -68,18 +71,19 @@ $$\begin {array}{c}

\nabla \cdot \vec {\mathbf {B}} & = 0

\end {array}$$
\end {array}
$$
```

效果预览:
Preview:

![公式渲染图](img.webp)

### quiz(练习题)
### Quiz

#### 开启此功能
#### Enable this feature

在使用此功能前,需要在 Front-matter 里添加`quiz: true`,例如:
Before using this feature, you need to add `quiz: true` in the Front-matter, for example:

```markdown
---
Expand All @@ -88,110 +92,108 @@ quiz: true
---
```

#### 单选题
#### Multiple Choice Questions

1-n 个待选项且只有一个正确选项的练习题,格式如下:
For exercises with 1-n options and only one correct option, use the following format:

```markdown
1. 题目[]{.gap} {.quiz}
- 选项
- 正确选项 {.correct}
{.options}
1. Question[]{.gap} {.quiz} - Option - Correct option {.correct}
{.options}
```

作用如下:
The usage is as follows:

- `1.`:题号,必须使用。
- `[]{.gap}`:题目的挖空处,会渲染为横线(可选)。
- `{.correct}`:题目的正确选项。
- `{.options}`:选项列表的结束处。
- `1.`: Question number, must be used.
- `[]{.gap}`: Blank space in the question, rendered as a horizontal line (optional).
- `{.correct}`: Correct option in the question.
- `{.options}`: End of the options list.

例:
Example:

```markdown
1. 以下选项正确的是[]{.gap}。{.quiz}
- 这是选项 A
- 这是选项 B
- 这是选项 C
- 这是选项 D(正确答案) {.correct}
1. Which of the following options is correct?{.quiz}
- Option A
- Option B
- Option C
- Option D (correct answer) {.correct}
{.options}
```

### 多选题
### Multiple Choice Questions

有 2-n 个待选项且有多个正确选项的练习题,格式如下:
Exercise questions with 2 to more options and multiple correct options are formatted as follows:

```markdown
1. 题目 {.quiz .multi}
- 选项
- 正确选项 {.correct}
- 正确选项 {.correct}
1. Question {.quiz .multi}
- Option
- Correct option {.correct}
- Correct option {.correct}
{.options}
> - 这里是 A 选项的注解
> - 这里是 B 选项的注解
> - 这里是 C 选项的注解
> {.options}
> - Annotation for option A
> - Annotation for option B
> - Annotation for option C
> {.options}
```

作用如下:
The usage is as follows:

- `1.`:题号,必须使用。
- `{.correct}`:题目的正确选项。
- `{.options}`:选项列表的结束处(使用缩进控制)。
- `1.`: Question number, must be used.
- `{.correct}`: Correct option in the question.
- `{.options}`: End of the options list (use indentation to control).

## Hexo 标签
## Hexo Tags

### links(链接块)
### links (Link Block)

::: tip
此标签用于以富媒体形式表现某链接,可用于友链、网站分享和功能合集等。
This tag is used to represent a link in rich media format, and can be used for friend links, website sharing, and feature collections, etc.
:::

配置格式如下:
The configuration format is as follows:

```yaml
- site: # 主标题
owner: # 站点所有者(选填)
url: # 站点链接
desc: # 站点描述(选填)
image: # 站点图像(选填)
color: # 站点颜色(选填)
- site: # Main title
owner: # Site owner (optional)
url: # Site link
desc: # Site description (optional)
image: # Site image (optional)
color: # Site color (optional)
```
- `color`:需要使用双引号包裹,值为大写的 16 进制颜色代码。
- `color`: Needs to be wrapped in double quotes and the value should be a uppercase hexadecimal color code.

在文章中使用:
Used in the article:
::: code-tabs#shell
@tab 文章内嵌
@tab Embedded in the article

```text
{% links %}
- site: # 主标题
owner: # 站点所有者(选填)
url: # 站点链接
desc: # 站点描述(选填)
image: # 站点图像(选填)
color: # 站点颜色(选填)
# 多链接参考 yaml 列表格式
- site: # Main title
owner: # Site owner (optional)
url: # Site link
desc: # Site description (optional)
image: # Site image (optional)
color: # Site color (optional)
# Multiple link reference YAML list format
{% endlinks %}
```

@tab 外部文件
@tab External File

```text
# path 为一个 yaml 文件
# path is a yaml file
{% linksfile [path] %}
```

示例文件:
Example:

```yaml
- site: # 主标题
owner: # 站点所有者(选填)
url: # 站点链接
desc: # 站点描述(选填)
image: # 站点图像(选填)
color: # 站点颜色(选填)
- site: # Main title
owner: # Site owner (optional)
url: # Site link
desc: # Site description (optional)
image: # Site image (optional)
color: # Site color (optional)
```

:::

0 comments on commit 83124ed

Please sign in to comment.