Hello,
I have a shortcode that displays a callout box.
It worked fine for displaying a code block until I switched to using Markdown from Org format. Now, it doesn’t work. Here is the content of my shortcode:
{{< callout "note" >}}
The # sign means ... **something like that**
```
$ su -x sdcx
```
{{</callout>}}
produces
<div class="callout note">
<p class="callout-title"><em>NOTE</em></p>
<p><p>The # sign means … <strong>something like that</strong></p>
<pre tabindex="0"><code>$ su -x sdcx
</code></pre></p>
</div>
which seems to work pretty well…???
Hint: with hugo 0.132+ you could also use an blockquote render hook of type alert and write something like that: (which formats nicer in visual studio code preview)
> [!NOTE] Note Title
>
> The # sign means ... **something like that**
> ```
> $ su -x sdcx
> ```
git clone --single-branch -b hugo-forum-topic-52136 https://github.com/jmooring/hugo-testing hugo-forum-topic-52136
cd hugo-forum-topic-52136
hugo server
# hugo version
hugo v0.135.0+extended freebsd/amd64 BuildDate=2024-09-29T15:55:47Z+0000 VendorInfo=freebsd
I’m using Hugo from the FreeBSD 14.1 repository. pkg install gohugo. I think it’s a bit outdated compared to the version on the official site. The only reason I opted for it because it auto-updates whenever a new version is published in the repository.
This behavior is (unfortunately) expected, and yet another reason to always use .Page.RenderString instead of markdownify.
At some point we aliased markdownify to site.Home.RenderString. So if the home page is an .org file, and the current page is an .md page, the markdownify function thinks its input is org instead of markdown.