a Hugo partial condition in head works fine for list page such as {{ if eq .Section "contact" }} but there is no list page in the section contact. I have tried multiple variations but failed.
I have tried these methods out of desperation:
{{ if and .IsPage (eq .Section "contact") }}
{{ if and (eq .Section "contact") (eq .IsPage true) }}
How can I tell Hugo that if section “contact” single page not list page then add this script??
On my website and more specifically only on the contact page I want to include the leaflet css/js in the head tag. Since I only have map on the contact page it is not useful to have css and js on all pages.
I cannot make Hugo work to say if the page is /contact/ then in <head> add <script>leaflet JS</script>
Any idea on how to let Hugo only add a script if the page is a contact page?
the directory structure is like this /content/en/contact/index.md
Again no success I remember the method I am trying to use that I learnt 2-3 years ago were working previously.So what is the solution or trick now with the newer version of Hugo I am unable to understand.