feat: add gist shortcode

This commit is contained in:
ZhenShuo Leo
2025-05-26 13:05:52 +08:00
parent 1d21656d5e
commit eb0d04a014
5 changed files with 113 additions and 0 deletions
@@ -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.