# \#shortcodes

**URL:** https://discourse.gohugo.io/tag/shortcodes/81.md

[Latest](https://discourse.gohugo.io/latest.md) · [Categories](https://discourse.gohugo.io/categories.md) · [Tags](https://discourse.gohugo.io/tags.md)

---

## [Shortcodes and build order?](https://discourse.gohugo.io/t/shortcodes-and-build-order/57654)

<div class="topic-metadata">

**Author:** [@pgadey](https://discourse.gohugo.io/u/pgadey)\
**Replies:** 4\
**Last updated:** [October 12, 2026, 11:52pm UTC](https://discourse.gohugo.io/t/shortcodes-and-build-order/57654 "2026-10-12T23:52:31Z")

</div>

On my Hugo site, I’ve implemented a pair of shortcodes “gather” and “dump.” The purpose of gather is to collect up a bunch of similar content, and dump puts it all in one place. However, the mechanism that I used to impl…

---

## [Defining and validating reusable arguments in Hugo](https://discourse.gohugo.io/t/defining-and-validating-reusable-arguments-in-hugo/57651)

<div class="topic-metadata">

**Author:** [@markdumay](https://discourse.gohugo.io/u/markdumay)\
**Replies:** 4\
**Last updated:** [October 12, 2026, 12:33pm UTC](https://discourse.gohugo.io/t/defining-and-validating-reusable-arguments-in-hugo/57651 "2026-10-12T12:33:09Z")

</div>

Hinode is a Hugo theme in which most shortcodes wrap a partial that handles the actual rendering. This lets the same component be used from Markdown content and from layout templates, but it also means the component’s ar…

---

## [How to render a link inside .Inner](https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598)

<div class="topic-metadata">

**Author:** [@choox](https://discourse.gohugo.io/u/choox)\
**Replies:** 2\
**Last updated:** [September 28, 2026, 2:46pm UTC](https://discourse.gohugo.io/t/how-to-render-a-link-inside-inner/57598 "2026-09-28T14:46:45Z")

</div>

Hello, I am trying a write a very simple shortcode, its core functionality looks like this: \<!-- layouts/\_shortcodes/test.html --\> \<div class="some-class"\> {{ .Inner }} \</div\> Now I want to render a link inside the \<…

---

## [Fit: unsupported JPEG feature](https://discourse.gohugo.io/t/fit-unsupported-jpeg-feature/47161)

<div class="topic-metadata">

**Author:** [@DO3EET](https://discourse.gohugo.io/u/DO3EET)\
**Replies:** 11\
**Last updated:** [September 18, 2026, 5:40pm UTC](https://discourse.gohugo.io/t/fit-unsupported-jpeg-feature/47161 "2026-09-18T17:40:56Z")

</div>

Hi I have a problem with my shortcode on at least on of my photos. The error I get is: Error: error building site: "+PathToMyWebsiteSource+/content/post/myComputer20231119/index.md:41:1": failed to render shortcode "i…

---

## [Can a shortcode know the heading level of the section it sits in?](https://discourse.gohugo.io/t/can-a-shortcode-know-the-heading-level-of-the-section-it-sits-in/57428)

<div class="topic-metadata">

**Author:** [@olafk](https://discourse.gohugo.io/u/olafk)\
**Replies:** 8\
**Last updated:** [August 3, 2026, 11:20am UTC](https://discourse.gohugo.io/t/can-a-shortcode-know-the-heading-level-of-the-section-it-sits-in/57428 "2026-08-03T11:20:13Z")

</div>

Tested with hugo v0.155.2-d8c0dfccf72ab43db2b2bca1483a61c8660021d9+extended linux/amd64 BuildDate=2026-02-02T10:04:51Z VendorInfo=gohugoio What I am trying to do I have shortcodes that render a labelled block - a card, …

---

## [New audio and podcast oriented theme and shortcode in development - Feedback Appreciated](https://discourse.gohugo.io/t/new-audio-and-podcast-oriented-theme-and-shortcode-in-development-feedback-appreciated/57280)

<div class="topic-metadata">

**Author:** [@adurrr](https://discourse.gohugo.io/u/adurrr)\
**Replies:** 0\
**Last updated:** [June 17, 2026, 9:14pm UTC](https://discourse.gohugo.io/t/new-audio-and-podcast-oriented-theme-and-shortcode-in-development-feedback-appreciated/57280 "2026-06-17T21:14:23Z")

</div>

I built Wavecast, a Hugo theme and module that adds a persistent podcast/radio audio player to any Hugo site. Drop a shortcode into a page and the audio follows you across every page via a sticky footer bar for pause, se…

---

## [Custom footnote shortcode](https://discourse.gohugo.io/t/custom-footnote-shortcode/56892)

<div class="topic-metadata">

**Author:** [@dayglo](https://discourse.gohugo.io/u/dayglo)\
**Replies:** 3\
**Last updated:** [March 28, 2026, 1:10am UTC](https://discourse.gohugo.io/t/custom-footnote-shortcode/56892 "2026-03-28T01:10:59Z")

</div>

Hey everybody, I’ve been writing a few blog posts on my personal blog lately that have required me to link to references and I found the existing markdown syntax for footnotes a bit wanting so I rolled my own. Here’s th…

---

## [Why do shortcodes exist?](https://discourse.gohugo.io/t/why-do-shortcodes-exist/56878)

<div class="topic-metadata">

**Author:** [@ajustinfocus](https://discourse.gohugo.io/u/ajustinfocus)\
**Replies:** 7\
**Last updated:** [March 18, 2026, 6:53am UTC](https://discourse.gohugo.io/t/why-do-shortcodes-exist/56878 "2026-03-18T06:53:49Z")

</div>

Why do shortcodes exist? Are there reasons why it would not be simpler to implement calling of partials (instead of shortcodes) from inside markdown? What can shortcodes do that an equivalent partial could not do? I cur…

---

## [Integrating Excalidraw into Hugo | shortcode & light/dark mode CSS support](https://discourse.gohugo.io/t/integrating-excalidraw-into-hugo-shortcode-light-dark-mode-css-support/56815)

<div class="topic-metadata">

**Author:** [@ProfessorLogout](https://discourse.gohugo.io/u/ProfessorLogout)\
**Replies:** 0\
**Last updated:** [March 7, 2026, 5:29am UTC](https://discourse.gohugo.io/t/integrating-excalidraw-into-hugo-shortcode-light-dark-mode-css-support/56815 "2026-03-07T05:29:30Z")

</div>

Hey everyone! I’ve added Excalidraw figure rendering via a shortcode to my Hugo site. Also figured out light and dark mode support. Thought it worth sharing: Excalidraw Figures in Hugo | marco.ninja Source is also av…

---

## [Using an ordinal in a card partial isn't working](https://discourse.gohugo.io/t/using-an-ordinal-in-a-card-partial-isnt-working/56737)

<div class="topic-metadata">

**Author:** [@hcarter](https://discourse.gohugo.io/u/hcarter)\
**Replies:** 4\
**Last updated:** [February 18, 2026, 8:48pm UTC](https://discourse.gohugo.io/t/using-an-ordinal-in-a-card-partial-isnt-working/56737 "2026-02-18T20:48:10Z")

</div>

Hello, I’m on a mission to learn how to “do” websites. I’m normally an embedded engineer. Hugo seemed interesting enough for what I wanted to do and exposed me to lots of things so I picked it. I’ve been having a great …

---

## [Using another .css file to modify React Components](https://discourse.gohugo.io/t/using-another-css-file-to-modify-react-components/56592)

<div class="topic-metadata">

**Author:** [@Paul\_NOWAK](https://discourse.gohugo.io/u/Paul_NOWAK)\
**Replies:** 1\
**Last updated:** [January 20, 2026, 12:15pm UTC](https://discourse.gohugo.io/t/using-another-css-file-to-modify-react-components/56592 "2026-01-20T12:15:21Z")

</div>

Hello, I’m working on the reation of a static site for a professionnel work. I’m building a Hugo site using the Blowfish theme and integrating some React components. Furthermore, I’m using a single custom.css file to up…

---

## [Shortcodes Proposal: Open Graph card (code inside)](https://discourse.gohugo.io/t/shortcodes-proposal-open-graph-card-code-inside/56557)

<div class="topic-metadata">

**Author:** [@juanbretti](https://discourse.gohugo.io/u/juanbretti)\
**Replies:** 0\
**Last updated:** [January 13, 2026, 8:52pm UTC](https://discourse.gohugo.io/t/shortcodes-proposal-open-graph-card-code-inside/56557 "2026-01-13T20:52:55Z")

</div>

Here is a proposal of a shortcode for Open Graph. Following Facebook Platform - Wikipedia This code will create a card like the following: In case of fallback, will show a short banner. The code of layouts\\shortcod…

---

## [Implementing .Width and .Height for video resources](https://discourse.gohugo.io/t/implementing-width-and-height-for-video-resources/56251)

<div class="topic-metadata">

**Author:** [@Sighery](https://discourse.gohugo.io/u/Sighery)\
**Replies:** 4\
**Last updated:** [November 16, 2025, 11:10am UTC](https://discourse.gohugo.io/t/implementing-width-and-height-for-video-resources/56251 "2025-11-16T11:10:55Z")

</div>

Hello everyone! I think like probably many are already doing, I have images in my site that I need to dynamically resize through CSS. I also use lazy loading so that makes it a bit hard for browsers to know how many pix…

---

## [Why does .Resize increase the image size even when the original asset size is smaller?](https://discourse.gohugo.io/t/why-does-resize-increase-the-image-size-even-when-the-original-asset-size-is-smaller/56244)

<div class="topic-metadata">

**Author:** [@user645235](https://discourse.gohugo.io/u/user645235)\
**Replies:** 2\
**Last updated:** [November 13, 2025, 8:17am UTC](https://discourse.gohugo.io/t/why-does-resize-increase-the-image-size-even-when-the-original-asset-size-is-smaller/56244 "2025-11-13T08:17:49Z")

</div>

Hello, friends! I have a simple image shortcode called webp.html, shown below: {{- $src := .Get "src" -}} {{- $alt := .Get "alt" -}} {{- $img := resources.Get (printf "images/%s" $src) -}} {{- if $img -}} {{- $resize…

---

## [Hanging Indent Shortcode](https://discourse.gohugo.io/t/hanging-indent-shortcode/56140)

<div class="topic-metadata">

**Author:** [@stockphrase](https://discourse.gohugo.io/u/stockphrase)\
**Replies:** 2\
**Last updated:** [October 26, 2025, 10:01pm UTC](https://discourse.gohugo.io/t/hanging-indent-shortcode/56140 "2025-10-26T22:01:48Z")

</div>

I was the OP on this thread, which investigates how to create a hanging indent for formal citation of sources. For some reason, this solution has stopped working. The shortcode (mla-ref.html) no longer results in the ha…

---

## [Shortcode to display datas from json file](https://discourse.gohugo.io/t/shortcode-to-display-datas-from-json-file/56118)

<div class="topic-metadata">

**Author:** [@Polarhardboiled](https://discourse.gohugo.io/u/Polarhardboiled)\
**Replies:** 5\
**Last updated:** [October 21, 2025, 7:53am UTC](https://discourse.gohugo.io/t/shortcode-to-display-datas-from-json-file/56118 "2025-10-21T07:53:18Z")

</div>

I am trying to have a shortcode to display datas from a json file as a table or a list using the new function transform.Unmarshal. For example having the following json file: { "device": "item 1", "bran…

---

## [Nested shortcode rendering](https://discourse.gohugo.io/t/nested-shortcode-rendering/56012)

<div class="topic-metadata">

**Author:** [@Morteza\_Karimi](https://discourse.gohugo.io/u/Morteza_Karimi)\
**Replies:** 18\
**Last updated:** [October 7, 2025, 3:09am UTC](https://discourse.gohugo.io/t/nested-shortcode-rendering/56012 "2025-10-07T03:09:30Z")

</div>

This page uses a callout shortcode with a command shortcode nested in it. The problem I’m seeing is that command is rendered on a separate line (the \<p\> tag for the text preceding it is closed when I look at the raw htm…

---

## [Store not working as expected (at least for me)](https://discourse.gohugo.io/t/store-not-working-as-expected-at-least-for-me/55994)

<div class="topic-metadata">

**Author:** [@ferang](https://discourse.gohugo.io/u/ferang)\
**Replies:** 1\
**Last updated:** [September 29, 2025, 7:07pm UTC](https://discourse.gohugo.io/t/store-not-working-as-expected-at-least-for-me/55994 "2025-09-29T19:07:24Z")

</div>

Hello, as it is not possible to get data from inner shortcodes or siblings from inner shortcodes I tried the following approach to create a gallery. My issue is that when clicking on an image it should open in a lightbo…

---

## [Using relref with another shortcode](https://discourse.gohugo.io/t/using-relref-with-another-shortcode/55017)

<div class="topic-metadata">

**Author:** [@oceanclub](https://discourse.gohugo.io/u/oceanclub)\
**Replies:** 4\
**Last updated:** [September 26, 2025, 12:14pm UTC](https://discourse.gohugo.io/t/using-relref-with-another-shortcode/55017 "2025-09-26T12:14:47Z")

</div>

I have a shortcode which produces the latest version of a product. However, I can’t simply use that within the relref shortcode (that is, something like {{\< relref "base/{{\< version \>}}/topic.md" \>}} will not work). Has…

---

## [Vimeo shortcode not working with reveal.js](https://discourse.gohugo.io/t/vimeo-shortcode-not-working-with-reveal-js/55871)

<div class="topic-metadata">

**Author:** [@alcarazr](https://discourse.gohugo.io/u/alcarazr)\
**Replies:** 1\
**Last updated:** [September 6, 2025, 2:55pm UTC](https://discourse.gohugo.io/t/vimeo-shortcode-not-working-with-reveal-js/55871 "2025-09-06T14:55:25Z")

</div>

I’ve got a strange issue here. My website uses Hugo Blox (repo here), which has a module for integrating reveal.js with Hugo. The vimeo shortcode works perfectly fine with normal markdown pages, but when including a Vime…

---

## [Template for shortcode not found](https://discourse.gohugo.io/t/template-for-shortcode-not-found/55867)

<div class="topic-metadata">

**Author:** [@SpeedOfEve](https://discourse.gohugo.io/u/SpeedOfEve)\
**Replies:** 2\
**Last updated:** [September 6, 2025, 1:19am UTC](https://discourse.gohugo.io/t/template-for-shortcode-not-found/55867 "2025-09-06T01:19:56Z")

</div>

Hello everyone, I’m working on a site for a TTRPG. I read the page on creating shortcodes, but I keep getting “failed to extract shortcode: template for shortcode “ability” not found.” However, I’m not seeing what I’m d…

---

## [I have a list of params in .yaml - which is the best way to render a part of it in content?](https://discourse.gohugo.io/t/i-have-a-list-of-params-in-yaml-which-is-the-best-way-to-render-a-part-of-it-in-content/55831)

<div class="topic-metadata">

**Author:** [@ololiuhqui](https://discourse.gohugo.io/u/ololiuhqui)\
**Replies:** 1\
**Last updated:** [September 1, 2025, 6:23pm UTC](https://discourse.gohugo.io/t/i-have-a-list-of-params-in-yaml-which-is-the-best-way-to-render-a-part-of-it-in-content/55831 "2025-09-01T18:23:46Z")

</div>

Let’s say I have a list of params written in yaml, like a little database. Eg. a list of cites with their respective temperature. Let’s say I want to use part of that content in a post. For example I wanna show New York…

---

## [.Page.Ressources.Get is NIL on automatic rebuild](https://discourse.gohugo.io/t/page-ressources-get-is-nil-on-automatic-rebuild/55737)

<div class="topic-metadata">

**Author:** [@avanc](https://discourse.gohugo.io/u/avanc)\
**Replies:** 14\
**Last updated:** [August 22, 2025, 9:02am UTC](https://discourse.gohugo.io/t/page-ressources-get-is-nil-on-automatic-rebuild/55737 "2025-08-22T09:02:16Z")

</div>

Hello, I have the following page bundles: ├── content │ ├── posts │ │ ├── post1 │ │ │ ├── image1.jpg │ │ │ └── index.md │ │ ├── post2 │ │ │ ├── image2.jpg │ │ │ └── index.md │ │ ├─…

---

## [Issues using \`Page.Resources.Get\` within a shortcode](https://discourse.gohugo.io/t/issues-using-page-resources-get-within-a-shortcode/55585)

<div class="topic-metadata">

**Author:** [@al0f](https://discourse.gohugo.io/u/al0f)\
**Replies:** 1\
**Last updated:** [August 7, 2025, 7:34am UTC](https://discourse.gohugo.io/t/issues-using-page-resources-get-within-a-shortcode/55585 "2025-08-07T07:34:47Z")

</div>

I’m trying to make a shortcode to downscale images so that a smaller preview version is displayed on the page. The (truncated) directory tree is as follows: . ├── content │ ├── assets │ │ ├── al2f\_button\_html.png…

---

## [Updating from Err to TryValue?](https://discourse.gohugo.io/t/updating-from-err-to-tryvalue/55568)

<div class="topic-metadata">

**Author:** [@abc3](https://discourse.gohugo.io/u/abc3)\
**Replies:** 16\
**Last updated:** [August 5, 2025, 10:06pm UTC](https://discourse.gohugo.io/t/updating-from-err-to-tryvalue/55568 "2025-08-05T22:06:19Z")

</div>

It looks like a recent Hugo update created an incompatibility for a shortcode that jmooring was extraordinarily helpful in guiding me through in an October 2024 thread, “Custom shortcode to display the date when a remote…

---

## [How to use backticks inside a multiline shortcode parameter](https://discourse.gohugo.io/t/how-to-use-backticks-inside-a-multiline-shortcode-parameter/55443)

<div class="topic-metadata">

**Author:** [@bbaovanc](https://discourse.gohugo.io/u/bbaovanc)\
**Replies:** 2\
**Last updated:** [July 30, 2025, 4:58am UTC](https://discourse.gohugo.io/t/how-to-use-backticks-inside-a-multiline-shortcode-parameter/55443 "2025-07-30T04:58:09Z")

</div>

I just made a figure shortcode which can embed a page resource and be called several ways (if I made the syntax awkward, advice is welcome) {{\< figure src="foo.webp" caption="Awesome words" /\>}} {{\< figure caption="Awe…

---

## [TableOfContents doesn't render headings correctly that contains shortcode](https://discourse.gohugo.io/t/tableofcontents-doesnt-render-headings-correctly-that-contains-shortcode/55399)

<div class="topic-metadata">

**Author:** [@razon](https://discourse.gohugo.io/u/razon)\
**Replies:** 5\
**Last updated:** [July 24, 2025, 9:02pm UTC](https://discourse.gohugo.io/t/tableofcontents-doesnt-render-headings-correctly-that-contains-shortcode/55399 "2025-07-24T21:02:20Z")

</div>

Hi, I found that TableOfContents would not render the shortcode that with the headings. ## Heading with Shortcode: {{\< foo \>}} The shortcode output the bar only for testing. As the image shown, the heading was rendere…

---

## [How to move a \<style\> block generated in a shortcode to the HTML head?](https://discourse.gohugo.io/t/how-to-move-a-style-block-generated-in-a-shortcode-to-the-html-head/55367)

<div class="topic-metadata">

**Author:** [@realpixelcode](https://discourse.gohugo.io/u/realpixelcode)\
**Replies:** 2\
**Last updated:** [July 18, 2025, 7:41pm UTC](https://discourse.gohugo.io/t/how-to-move-a-style-block-generated-in-a-shortcode-to-the-html-head/55367 "2025-07-18T19:41:22Z")

</div>

I’ve developed custom footnote shortcodes which add CSS styling based on the reference elements’ ID attributes. In other words, it’s not possible to “foresee” the IDs and to write the CSS statically (in advance); it must…

---

## [Need advice about organizing data files (yml, json, xml) for simple pages](https://discourse.gohugo.io/t/need-advice-about-organizing-data-files-yml-json-xml-for-simple-pages/55211)

<div class="topic-metadata">

**Author:** [@hoanguyenn2015](https://discourse.gohugo.io/u/hoanguyenn2015)\
**Replies:** 1\
**Last updated:** [July 4, 2025, 3:27am UTC](https://discourse.gohugo.io/t/need-advice-about-organizing-data-files-yml-json-xml-for-simple-pages/55211 "2025-07-04T03:27:41Z")

</div>

Hello Hugo users. I’m building a static site with dozens of quizzes/exams (currently ~50 and growing), and I’m finding an approach to manage them. There are many quiz types. Here is the demo of 2 of them. https://demo…

---

## [Weird "{{\_\_hugo\_ctx pid=34}}" inside .RenderShortcodes](https://discourse.gohugo.io/t/weird-hugo-ctx-pid-34-inside-rendershortcodes/55176)

<div class="topic-metadata">

**Author:** [@bbaovanc](https://discourse.gohugo.io/u/bbaovanc)\
**Replies:** 5\
**Last updated:** [June 29, 2025, 11:32pm UTC](https://discourse.gohugo.io/t/weird-hugo-ctx-pid-34-inside-rendershortcodes/55176 "2025-06-29T23:32:21Z")

</div>

Coming from Render not triggered from modifying file pulled in by \`readFile\` · Issue #13823 · gohugoio/hugo · GitHub, I added an “include” shortcode: {{ with .Get 0 }} {{ with $.Page.GetPage . }} {{- .RenderShortc…

[Next page](https://discourse.gohugo.io/tag/shortcodes/81.md?match_all_tags=true&page=1&tags%5B%5D=shortcodes)
