jeudi 20 août 2020

if statments in golang hugo

I'm trying to create HTML layout partial to add different html elements using the front matter as a data source and hugo templating for the rendering. For example the front matter has this property

---
animal:
  type:"bear"
---

now the partial looks like this:



<p> Belongs to the Canine family, they have distinctive fangs. <p>


throws the following error when i run hugo server:

executing "partials/canine.html" at : wrong number of args for eq: want at least 1 got 0

Am i doing the piping of the or operators wrong ? Or what is the issue ?

the folder structure looks like this: the single.html is calling the animalsDetails.html this one is calling canine.html I don't think the it is the problem, but just in case.

|layouts 
  |_defaults
    single.html
  |partials
    animalDetails.html
    canine.html

Aucun commentaire:

Enregistrer un commentaire