Skip to content

Commit

Permalink
Fix: customMermaidURL can be used in site and frontmatter (matcornic#518
Browse files Browse the repository at this point in the history
)

Change param name to lower case,
since all site-level configuration keys are stored as lower case.
According to official hugo documentation:
https://gohugo.io/functions/isset/

This allows loading custom mermaid.js using the config option,
as specified in https://learn.netlify.app/en/basics/configuration/

Co-authored-by: Rasmus Stougaard <[email protected]>
  • Loading branch information
2 people authored and francesquini committed Nov 17, 2021
1 parent 1649972 commit dccf79c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
<script src="{{"js/hugo-learn.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script src="{{"js/hide_results.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
{{ if (or (and (ne .Params.disableMermaid nil) (not .Params.disableMermaid)) (not .Site.Params.disableMermaid)) }}
{{ if isset .Params "customMermaidURL" }}
{{ if isset .Params "custommermaidurl" }}
<script src="{{ .Params.customMermaidURL }}"></script>
{{ else if isset .Site.Params "customMermaidURL" }}
{{ else if isset .Site.Params "custommermaidurl" }}
<script src="{{ .Site.Params.customMermaidURL }}"></script>
{{ else }}
<script src="{{"mermaid/mermaid.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
Expand Down

0 comments on commit dccf79c

Please sign in to comment.