gohugoio / hugoDocs

The source for https://gohugo.io/
Apache License 2.0
1.06k stars 1.49k forks source link

Error on mermaid docs #2681

Closed HUGHNew closed 2 months ago

HUGHNew commented 2 months ago

I think this is a field mismatch in mermaid support docs

In the code, the hasMermaid key is saved in .Page.Store (L57), but it's retrived by .Store (L63).

https://github.com/gohugoio/hugoDocs/blob/cf8dd703400ca013e84ee5012229d91b8f932d26/content/en/content-management/diagrams.md?plain=1#L57 https://github.com/gohugoio/hugoDocs/blob/cf8dd703400ca013e84ee5012229d91b8f932d26/content/en/content-management/diagrams.md?plain=1#L63

bep commented 2 months ago

Thanks, but the documentation is correct; these are 2 different contexts; in a single template the "." is the Page; in the render hook context, you can access that same page via .Page.

We could have used .Page in both examples, that would still work.