I understand this is a mess, but maybe someone can help.
This repository holds my website stripped to just two posts to indicate the problem. It is based on the LoveIt theme with my modifications, and it’s my modifications I can’t debug here.
The problem: /posts/2020/english.en.md uses {{< mermaid >}} shortcode that does not render. The shortcode is supposed to work by setting a field in .Page.Scratch(“this”) that later is detected in /layouts/partials/assets.html that injects the corresponding style and script. It looks like .Page.Scratch set up in this shortcode doesn’t persist.
hugo && grep "mermaid.min" public/en/posts/2020/english/index.html - nothing
The same shortcode in the other post (/posts/2020/russian.md) renders just fine:
hugo && grep "mermaid.min" public/posts/2020/russian/index.html - shows the expected output.
Weird things that confuse me:
- default language rendering properly while another language isn’t is weird in itself, right?
- deleting /content/posts/2020/russian.md results in correct rendering of the remaining post
- deleting line 27 in themes/loveit/layouts/index.html results in correct rendering
- deleting line 43 in themes/loveit/layouts/index.html results in correct rendering
Why? For the love of gods, what does lang.Merge on index page have to do with the rendering of the individual posts? Why does showing summaries on the index page affect individual post rendering?
Am I dumb? Am I missing something obvious?
