Add gist shortcode

This commit is contained in:
James Panther
2025-02-24 10:11:02 +11:00
parent 19f2fdd241
commit 52663e5ad4
3 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
- New icon for 'kofi' ([#976](https://github.com/jpanther/congo/pull/976))
- New `gist` shortcode as the built-in Hugo version has been deprecated
- New icon for `kofi` ([#976](https://github.com/jpanther/congo/pull/976))
### Changed
@@ -155,6 +155,18 @@ Congo also supports automatic conversion of images included using standard Markd
{{< figure src="abstract.jpg" alt="Abstract purple artwork" caption="Photo by [Jr Korpa](https://unsplash.com/@jrkorpa) on [Unsplash](https://unsplash.com/)" >}}
## Gist
The `gist` shortcode can be used to embed a GitHub Gist. It requires two unnamed parameters: the username and ID of the Gist.
**Example:**
```md
{{</* jpanther 26292111fe1eb8e31c60f6dbfef9df28 */>}}
```
{{< gist jpanther 26292111fe1eb8e31c60f6dbfef9df28 >}}
## Icon
`icon` outputs an SVG icon and takes the icon name as its only parameter. The icon is scaled to match the current text size.
+1
View 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>