halogenica / beautifulhugo

Theme for the Hugo static website generator
Other
1.15k stars 603 forks source link

Fix details for Hugo 0.60+ #323

Closed henryiii closed 3 years ago

henryiii commented 4 years ago

The markdown parser now strips raw html (since Hugo 0.60), so {{<>}} is required for all shortcodes containing HTML. This will cause the details shortcode to start failing to render markdown if the change is made. This fixes it to continue to render markdown inside.

henryiii commented 4 years ago

@halogenica, any chance this fix can go in? I was the original author of the details shortcode in #168.

akiradeveloper commented 4 years ago

I am sorry. I see some inconsistency between what you said and what you did. What you did is just piping the value into markdownify function not surrounding something with the brackets.

henryiii commented 4 years ago

The fix is to manually ensure that markdownify is called in the function (this PR), and then for users to use {{< details "..." >}} instead of {{% details "..." %}}. It really doesn't change much if {{% is used; 0.60+ will not render it properly. However, {{< will work, and is the correct path going forward.

(If there's an example somewhere, that should be fixed here too, didn't look for it)

henryiii commented 4 years ago

Thanks! I fixed the example.