2024-12-31 01:01:56 +00:00
|
|
|
---
|
|
|
|
title: その他のショートコード
|
|
|
|
linkTitle: その他
|
2025-08-14 23:49:06 +08:00
|
|
|
next: /docs/guide/deploy-site
|
2024-12-31 01:01:56 +00:00
|
|
|
---
|
|
|
|
|
2025-08-22 00:31:16 +02:00
|
|
|
{{< callout type="warning" >}}
|
2025-08-14 23:49:06 +08:00
|
|
|
これらの一部は Hugo 組み込みのショートコードです。
|
2024-12-31 01:01:56 +00:00
|
|
|
これらのショートコードは安定性が低く、いつでも変更される可能性があります。
|
|
|
|
{{< /callout >}}
|
|
|
|
|
2025-08-23 15:42:23 +02:00
|
|
|
### 例
|
|
|
|
|
|
|
|
{{< badge "default" >}}
|
|
|
|
{{< badge content="border" border=false >}}
|
|
|
|
{{< badge content="color" color="green" >}}
|
|
|
|
{{< badge content="link" link="https://github.com/imfing/hextra/releases" >}}
|
|
|
|
{{< badge content="icon" icon="sparkles" >}}
|
|
|
|
|
|
|
|
### 使用法
|
|
|
|
|
|
|
|
#### デフォルト
|
|
|
|
|
|
|
|
{{< badge "Badge" >}}
|
2024-12-31 01:01:56 +00:00
|
|
|
|
|
|
|
```
|
2025-08-14 23:49:06 +08:00
|
|
|
{{</* badge "Badge" */>}}
|
2024-12-31 01:01:56 +00:00
|
|
|
```
|
|
|
|
|
2025-08-23 15:42:23 +02:00
|
|
|
#### 色
|
2024-12-31 01:01:56 +00:00
|
|
|
|
2025-08-23 15:42:23 +02:00
|
|
|
{{< badge content="Badge" >}}
|
|
|
|
{{< badge content="Badge" color="purple" >}}
|
|
|
|
{{< badge content="Badge" color="indigo" >}}
|
|
|
|
{{< badge content="Badge" color="blue" >}}
|
|
|
|
{{< badge content="Badge" color="green" >}}
|
|
|
|
{{< badge content="Badge" color="yellow" >}}
|
|
|
|
{{< badge content="Badge" color="amber" >}}
|
|
|
|
{{< badge content="Badge" color="orange" >}}
|
|
|
|
{{< badge content="Badge" color="red" >}}
|
2024-12-31 01:01:56 +00:00
|
|
|
|
|
|
|
```
|
2025-08-23 15:42:23 +02:00
|
|
|
{{</* badge content="Badge" */>}}
|
|
|
|
{{</* badge content="Badge" color="purple" */>}}
|
|
|
|
{{</* badge content="Badge" color="indigo" */>}}
|
|
|
|
{{</* badge content="Badge" color="blue" */>}}
|
|
|
|
{{</* badge content="Badge" color="green" */>}}
|
|
|
|
{{</* badge content="Badge" color="yellow" */>}}
|
|
|
|
{{</* badge content="Badge" color="amber" */>}}
|
|
|
|
{{</* badge content="Badge" color="orange" */>}}
|
|
|
|
{{</* badge content="Badge" color="red" */>}}
|
2024-12-31 01:01:56 +00:00
|
|
|
```
|
|
|
|
|
2025-08-23 15:42:23 +02:00
|
|
|
{{< badge content="Badge" border=false >}}
|
|
|
|
{{< badge content="Badge" color="purple" border=false >}}
|
|
|
|
{{< badge content="Badge" color="indigo" border=false >}}
|
|
|
|
{{< badge content="Badge" color="blue" border=false >}}
|
|
|
|
{{< badge content="Badge" color="green" border=false >}}
|
|
|
|
{{< badge content="Badge" color="yellow" border=false >}}
|
|
|
|
{{< badge content="Badge" color="amber" border=false >}}
|
|
|
|
{{< badge content="Badge" color="orange" border=false >}}
|
|
|
|
{{< badge content="Badge" color="red" border=false >}}
|
2024-12-31 01:01:56 +00:00
|
|
|
|
2025-08-23 15:42:23 +02:00
|
|
|
```
|
|
|
|
{{</* badge content="Badge" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="purple" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="indigo" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="blue" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="green" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="yellow" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="amber" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="orange" border=false */>}}
|
|
|
|
{{</* badge content="Badge" color="red" border=false */>}}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### 変種
|
2024-12-31 01:01:56 +00:00
|
|
|
|
2025-08-23 15:42:23 +02:00
|
|
|
{{< badge content="Badge" icon="sparkles" >}}
|
|
|
|
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}
|
2024-12-31 01:01:56 +00:00
|
|
|
|
|
|
|
```
|
2025-08-23 15:42:23 +02:00
|
|
|
{{</* badge content="Badge" icon="sparkles" */>}}
|
2025-08-14 23:49:06 +08:00
|
|
|
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" */>}}
|
2024-12-31 01:01:56 +00:00
|
|
|
```
|
|
|
|
|
2025-08-17 19:42:59 +02:00
|
|
|
### オプション
|
|
|
|
|
2025-08-23 15:42:23 +02:00
|
|
|
| パラメータ | 説明 |
|
|
|
|
|-----------|--------------------------------------------------------------------------------------------------------------------------|
|
|
|
|
| `content` | バッジのテキスト。 |
|
|
|
|
| `link` | バッジのリンク。 |
|
|
|
|
| `icon` | バッジのアイコン。 |
|
|
|
|
| `color` | The color of the badge. <br/> `gray` (default), `purple`, `indigo`, `blue`, `green`, `yellow`, `amber`, `orange`, `red`. |
|
|
|
|
| `class` | バッジのクラス。 |
|
|
|
|
| `border` | 境界線を追加または削除します (デフォルト: true)。 |
|
2025-08-17 19:42:59 +02:00
|
|
|
|
2024-12-31 01:01:56 +00:00
|
|
|
## YouTube
|
|
|
|
|
2025-08-14 23:49:06 +08:00
|
|
|
YouTube 動画を埋め込みます。
|
2024-12-31 01:01:56 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{{</* youtube VIDEO_ID */>}}
|
|
|
|
```
|
|
|
|
|
|
|
|
結果:
|
|
|
|
|
|
|
|
{{< youtube id=dQw4w9WgXcQ loading=lazy >}}
|
|
|
|
|
2025-08-14 23:49:06 +08:00
|
|
|
詳細については、[Hugo の YouTube ショートコード](https://gohugo.io/content-management/shortcodes/#youtube)を参照してください。
|
2024-12-31 01:01:56 +00:00
|
|
|
|
|
|
|
## PDF
|
|
|
|
|
2025-08-14 23:49:06 +08:00
|
|
|
PDF ショートコードを使用すると、コンテンツ内に PDF ファイルを埋め込むことができます。
|
2024-12-31 01:01:56 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{{</* pdf "https://example.com/sample.pdf" */>}}
|
|
|
|
```
|
|
|
|
|
2025-08-14 23:49:06 +08:00
|
|
|
プロジェクトディレクトリ内に PDF ファイルを配置し、相対パスを使用することもできます。
|
2024-12-31 01:01:56 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{{</* pdf "path/to/file.pdf" */>}}
|
|
|
|
```
|
|
|
|
|
|
|
|
例:
|
|
|
|
|
|
|
|
{{< pdf "https://upload.wikimedia.org/wikipedia/commons/1/13/Example.pdf" >}}
|