summaryrefslogtreecommitdiffstats
path: root/docs/content/en/shortcodes/gist.md
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2025-01-23 09:47:46 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2025-01-23 09:47:46 +0100
commit43307b07f8ae166cedc149b9dffeb7a0efdd3f34 (patch)
treef9d9fdcfb483eb70e31643aa3dcd4a222cb1740d /docs/content/en/shortcodes/gist.md
parent7f0f50b133e768bd939bfc2be7e09ecebba270ae (diff)
parent346b60358dd8ec2ca228e6635bff9d7914b398b7 (diff)
downloadhugo-43307b07f8ae166cedc149b9dffeb7a0efdd3f34.tar.gz
hugo-43307b07f8ae166cedc149b9dffeb7a0efdd3f34.zip
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
Diffstat (limited to 'docs/content/en/shortcodes/gist.md')
-rwxr-xr-xdocs/content/en/shortcodes/gist.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/content/en/shortcodes/gist.md b/docs/content/en/shortcodes/gist.md
new file mode 100755
index 000000000..dc85f282c
--- /dev/null
+++ b/docs/content/en/shortcodes/gist.md
@@ -0,0 +1,41 @@
+---
+title: Gist
+description: Embed a GitHub Gist in your content using the gist shortcode.
+categories: [shortcodes]
+keywords: []
+menu:
+ docs:
+ parent: shortcodes
+ weight:
+weight:
+---
+
+{{% note %}}
+To override Hugo's embedded `gist` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
+
+[source code]: {{% eturl gist %}}
+{{% /note %}}
+
+To display a GitHub gist with this URL:
+
+```text
+https://gist.github.com/user/50a7482715eac222e230d1e64dd9a89b
+```
+
+Include this in your Markdown:
+
+```text
+{{</* gist user 23932424365401ffa5e9d9810102a477 */>}}
+```
+
+This will display all files in the gist alphabetically by file name.
+
+{{< gist jmooring 23932424365401ffa5e9d9810102a477 >}}
+
+To display a specific file within the gist:
+
+```text
+{{</* gist user 23932424365401ffa5e9d9810102a477 list.html */>}}
+```
+
+{{< gist jmooring 23932424365401ffa5e9d9810102a477 list.html >}}