Hi There
I am currently using:
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $.Scratch.Add "path" .Site.BaseURL }}
<ol class="breadcrumbs">
<li><a href="/">home</a></li>
{{ range $index, $element := split $url "/" }}
{{ $.Scratch.Add "path" $element }}
{{ if ne $element "" }}
<li><a href='{{ $.Scratch.Get "path" }}'>{{ . }}</a></li>
{{ $.Scratch.Add "path" "/" }}
{{ end }}
{{ end }}
</ol>
To create my breadcrumbs. However, I want to change it to allow for Microdata. For this I need to add:
<meta itemprop="position" content="1">
In every li element.
Where the content=“1” is an integer that increases with each addition to the list.
Using the above code, is there a way to make that happen?