alex-shpak / hugo-book

Hugo documentation theme as simple as plain book
https://hugo-book-demo.netlify.app
MIT License
3.21k stars 1.16k forks source link

links in shortcodes 'columns' do not work #605

Closed smillas-snow closed 4 months ago

smillas-snow commented 4 months ago

Hi, In one part of my document I want to use your 'columns' shortcodes, as it is very handy, but links to another page are not shown as links but it shows the code snipped as plain text, while on normal text paragraphs it works. I am not sure if this is a bug or some form of limitation. In case of the second, is there a way around it?

Thanks for your help.

alex-shpak commented 4 months ago

Hi! Can you please post your markdown example here?

smillas-snow commented 4 months ago
# text normal
bla bla bla [link][handbook_contribution] bla bla bla

# text in columns
bla bla bla
{{< columns >}} <!-- begin columns block -->
#### left
bla bla bla
<---> <!-- column separator -->
#### right
bla bla bla [link][handbook_contribution] bla bla bla
{{< /columns >}} <!-- end columns block -->

<!--PAGE REFERENCE DEFINITIONS-->
[handbook_contribution]: {{< ref "handbook/contributing-handbook.md" >}}

This is how it ends up for me: image

alex-shpak commented 4 months ago

Okay, I see, unfortunately that would not work, as shortcode for columns renders inner markdown it renders it in separate context, so reference is not visible for the renderer inside of the shortcode. You can simulate columns with html (just check what output shortcode creates) and that should work.

smillas-snow commented 4 months ago

Thank you