Merge pull request #2297 from ZhenShuo2021/feat/article-shortcode

 Feat: add options for article shortcode
This commit is contained in:
Nuno C.
2025-07-17 16:38:29 +01:00
committed by GitHub
7 changed files with 158 additions and 9 deletions

View File

@@ -72,15 +72,17 @@ This is an error!
| Parameter | Description |
| --------- | -------------------------------------------------------- |
| `link` | **Required.** the `.RelPermalink` to the target article. |
| `showSummary` | **Optional.** A boolean value indicating whether to show the article summary. If not set, the site's default configuration will be used. |
| `compactSummary` | **Optional.** A boolean value indicating whether to display the summary in compact mode. Default to false. |
<!-- prettier-ignore-end -->
**Example:**
```md
{{</* article link="/docs/welcome/" */>}}
{{</* article link="/it/docs/welcome/" showSummary=true compactSummary=true */>}}
```
{{< article link="/docs/welcome/" >}}
{{< article link="/it/docs/welcome/" showSummary=true compactSummary=true >}}
<br/><br/><br/>

View File

@@ -72,15 +72,17 @@ Twitter で私を[フォロー](https://twitter.com/nunocoracao)するのを忘
| パラメータ | 説明 |
| --------- | -------------------------------------------------------- |
| `link` | **必須** ターゲット記事への `.RelPermalink`。 |
| `showSummary` | **オプション** のブール値で、記事の要約を表示するかどうかを示します。設定されていない場合は、サイトのデフォルト設定が使用されます。 |
| `compactSummary` | **オプション** のブール値で、要約をコンパクトモードで表示するかどうかを示します。デフォルトは false です。 |
<!-- prettier-ignore-end -->
**例:**
```md
{{</* article link="/docs/welcome/" */>}}
{{</* article link="/ja/docs/welcome/" showSummary=true compactSummary=true */>}}
```
{{< article link="/docs/welcome/" >}}
{{< article link="/ja/docs/welcome/" showSummary=true compactSummary=true >}}
<br/><br/><br/>

View File

@@ -72,15 +72,17 @@ This is an error!
| Parameter | Description |
| --------- | -------------------------------------------------------- |
| `link` | **Required.** the `.RelPermalink` to the target article. |
| `showSummary` | **Optional.** A boolean value indicating whether to show the article summary. If not set, the site's default configuration will be used. |
| `compactSummary` | **Optional.** A boolean value indicating whether to display the summary in compact mode. Default to false. |
<!-- prettier-ignore-end -->
**Example:**
```md
{{</* article link="/docs/welcome/" */>}}
{{</* article link="/docs/welcome/" showSummary=true compactSummary=true */>}}
```
{{< article link="/docs/welcome/" >}}
{{< article link="/docs/welcome/" showSummary=true compactSummary=true >}}
<br/><br/><br/>

View File

@@ -72,15 +72,17 @@ This is an error!
| 参数 | 功能 |
| ------ | ------------------------------------- |
| `link` | **必填** 要嵌入文章的 `.RelPermalink` |
| `showSummary` | **可选** 布尔值,指示是否显示文章摘要。如果未设置,将使用站点的默认配置。 |
| `compactSummary` | **可选** 布尔值,指示是否以紧凑模式显示摘要。默认为 false。 |
<!-- prettier-ignore-end -->
**例如:**
```md
{{</* article link="/zh-cn/docs/welcome/" */>}}
{{</* article link="/zh-cn/docs/welcome/" showSummary=true compactSummary=true */>}}
```
{{< article link="/zh-cn/docs/welcome/" >}}
{{< article link="/zh-cn/docs/welcome/" showSummary=true compactSummary=true >}}
<br/><br/><br/>