mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
✨ feat: add gist shortcode
This commit is contained in:
@@ -345,6 +345,34 @@ In order to add images to the gallery, use `img` tags for each image and add `cl
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## Gist
|
||||
|
||||
`gist` shortcode allows you to embed a GitHub Gist directly into your content by specifying the Gist user, ID, and optionally a specific file.
|
||||
|
||||
| Parameter | Description |
|
||||
| -------------- | ------------------------------------------------------------------ |
|
||||
| `[0]` | [String] GitHub username |
|
||||
| `[1]` | [String] Gist ID |
|
||||
| `[2]` (optional)| [String] Filename within the Gist to embed (optional) |
|
||||
|
||||
**Example 1: Embed entire Gist**
|
||||
|
||||
```md
|
||||
{{</* gist "octocat" "6cad326836d38bd3a7ae" */>}}
|
||||
````
|
||||
|
||||
{{< gist "octocat" "6cad326836d38bd3a7ae" >}}
|
||||
|
||||
**Example 2: Embed specific file from Gist**
|
||||
|
||||
```md
|
||||
{{</* gist "rauchg" "2052694" "README.md" */>}}
|
||||
```
|
||||
|
||||
{{< gist "rauchg" "2052694" "README.md" >}}
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## GitHub Card
|
||||
|
||||
`github` allows you to quickly link a github repository, all while showing and updating in realtime stats about it, such as the number of stars and forks it has.
|
||||
|
||||
@@ -362,6 +362,34 @@ Blowfish も、標準の Markdown 構文を使用して含まれる画像の自
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## Gist
|
||||
|
||||
`gist`ショートコードは、Gistのユーザー名、ID、必要に応じて特定のファイル名を指定することで、GitHub Gistをコンテンツに直接埋め込むことができます。
|
||||
|
||||
| パラメーター | 説明 |
|
||||
| ------------ | -------------------------------- |
|
||||
| `[0]` | \[文字列] GitHubのユーザー名 |
|
||||
| `[1]` | \[文字列] GistのID |
|
||||
| `[2]`(オプション) | \[文字列] Gist内で埋め込む特定のファイル名(オプション) |
|
||||
|
||||
**例1:Gist全体を埋め込む**
|
||||
|
||||
```md
|
||||
{{</* gist "octocat" "6cad326836d38bd3a7ae" */>}}
|
||||
```
|
||||
|
||||
{{< gist "octocat" "6cad326836d38bd3a7ae" >}}
|
||||
|
||||
**例2:Gistの特定ファイルを埋め込む**
|
||||
|
||||
```md
|
||||
{{</* gist "rauchg" "2052694" "README.md" */>}}
|
||||
```
|
||||
|
||||
{{< gist "rauchg" "2052694" "README.md" >}}
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## Gitea カード
|
||||
|
||||
`gitea` を使用すると、gitea API を介して Gitea リポジトリをすばやくリンクでき、スターやフォークなどの統計に関するリアルタイムに更新できます。
|
||||
|
||||
@@ -365,6 +365,34 @@ In order to add images to the gallery, use `img` tags for each image and add `cl
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## Gist
|
||||
|
||||
`gist` shortcode allows you to embed a GitHub Gist directly into your content by specifying the Gist user, ID, and optionally a specific file.
|
||||
|
||||
| Parameter | Description |
|
||||
| -------------- | ------------------------------------------------------------------ |
|
||||
| `[0]` | [String] GitHub username |
|
||||
| `[1]` | [String] Gist ID |
|
||||
| `[2]` (optional)| [String] Filename within the Gist to embed (optional) |
|
||||
|
||||
**Example 1: Embed entire Gist**
|
||||
|
||||
```md
|
||||
{{</* gist "octocat" "6cad326836d38bd3a7ae" */>}}
|
||||
````
|
||||
|
||||
{{< gist "octocat" "6cad326836d38bd3a7ae" >}}
|
||||
|
||||
**Example 2: Embed specific file from Gist**
|
||||
|
||||
```md
|
||||
{{</* gist "rauchg" "2052694" "README.md" */>}}
|
||||
```
|
||||
|
||||
{{< gist "rauchg" "2052694" "README.md" >}}
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## Gitea Card
|
||||
|
||||
`gitea` allows you to quickly link a Gitea repository via the gitea API, providing real-time updates on stats such as stars and forks.
|
||||
|
||||
@@ -346,6 +346,34 @@ Blowfish 还支持使用标准 Markdown 语法自动转换图像。只需使用
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## Gist
|
||||
|
||||
`gist` 短代码允许你通过指定 Gist 用户名、ID 以及可选的特定文件,直接将 GitHub Gist 嵌入到内容中。
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --------- | ------------------------ |
|
||||
| `[0]` | \[字符串] GitHub 用户名 |
|
||||
| `[1]` | \[字符串] Gist ID |
|
||||
| `[2]`(可选) | \[字符串] Gist 中要嵌入的文件名(可选) |
|
||||
|
||||
**示例 1:嵌入整个 Gist**
|
||||
|
||||
```md
|
||||
{{</* gist "octocat" "6cad326836d38bd3a7ae" */>}}
|
||||
```
|
||||
|
||||
{{< gist "octocat" "6cad326836d38bd3a7ae" >}}
|
||||
|
||||
**示例 2:嵌入 Gist 中的特定文件**
|
||||
|
||||
```md
|
||||
{{</* gist "rauchg" "2052694" "README.md" */>}}
|
||||
```
|
||||
|
||||
{{< gist "rauchg" "2052694" "README.md" >}}
|
||||
|
||||
<br/><br/><br/>
|
||||
|
||||
## GitHub 卡片
|
||||
|
||||
`github` 允许您快速链接到 github Repo,同时显示和更新有关它的实时统计信息,例如它的 star 和 fork 数。
|
||||
|
||||
1
layouts/shortcodes/gist.html
Normal file
1
layouts/shortcodes/gist.html
Normal file
@@ -0,0 +1 @@
|
||||
<script src="https://gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>
|
||||
Reference in New Issue
Block a user