Hugo page content variables
Hugo content Markdown files cannot use Hugo variables directly. The way to access variables (including site parameters, data sources, and front matter) from content Markdown files is to use Hugo shortcodes or to use a custom template for those content pages. However, areas inside code fences cannot use shortcodes. What I wanted to do was make examples of code inside code fences used on several pages on my site update with a version number. However, I don’t currently see a feasible way to do this with Hugo that wouldn’t be overly specific to the particular set of examples. It’s OK, I wanted to note this limitation I ran into. An alternative is to use find/replace across files like “sed” or the VSCode GUI.