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
@@ -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.