Hello,
I’m trying to output params wrapped by p tag or a tag by whether they have links in their values.
Here are my config.toml.
[[params.footer]]
name = "Address"
url = false
[[params.footer]]
name = "GitHub"
url = "https://github.com/"
And my code is this.
<ul class="footer-contents">
{{ range .Site.Params.footer }}
{{ if ne .Params.footer.url false }}
<li class="footer-contents__item"><a href="{{ .url }}">{{ .name }}</a></li>
{{ else }}
<li><p class="footer-contents__item">{{ .name }}</p></li>
{{ end }}
{{ end }}
</ul>
I expeced that first Address should be rendered as p and second be a. But Hugo rendered both as a.
Is there any mistake for my logic or do I take wrong way at all?
Thank you,