Hi,
I am new to Hugo, and I know nothing about GoLang, so please excuse me if this is a noob question . I searched everywhere and couldn’t find a solution for my scenario.
I am creating a project page on my blog using Hugo Shortcodes. I am using nested shortcodes as I need a container for project boxes. The problem is, I want to accept array or comma separated values, the values I want to import in a span so that I can show them as tags or may be a list. Here are my shortcodes:
Parent :
<div class="projects">
{{.Inner}}
</div>
Child
<div class="project" style="width: 18rem;">
<div class="project__thumb">
{{ if .Get "src" }}
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}"
{{ end }}class="project-img-top">
{{ end }}
</div>
<div class="project__body">
{{if .Get "description"}}
<p class="project__description">{{.Get "description" | markdownify}}</p>
{{end}}
<div class="project__technologies">
<!-- <span class="technology">Javascript</span> -->
{{ .Get "technologies" | markdownify}}
</div>
</div>
</div>
Project technologies section is where I am failing to get the things right. I want to accept multiple values like "JavaScript, React"
or like ["JavaScript", "React"]
and I want to render them in span
or li
such as <span class="tags">Javascript</span>
or <li>Javascript</li>
.
Is it possible in Hugo, or do I need to try any alternative approach and what that should be ? Appreciate your help.