<div id="page">
<a id="top" class="skip-link screen-reader-text" href="#primary">skip to content</a>
{{- partial "header.html" . -}}
+ {{- partial "breadcrumbs.html" . -}}
<div id="content" class="site-content">
<div id="primary" class="content-area">
<main id="main" class="site-main">
{{ define "main" }}
-<article class="entry post">
- <header>
- <h2>{{ .Title }}</h2>
- </header>
- <div id="content">
+<article class="single-page">
+ <div id="page-content">
{{ .Content }}
</div>
</article>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
<li>
- <a href="{{.Permalink}}">{{.Date.Format "01-02-2006"}} | {{.Title}}</a>
+ <div>
+ <h3 class="article-title"><a href="{{.Permalink}}">{{.Title}}</a></h3>
+ <p class="byline">by {{ .Params.Author }} on {{.Date.Format "01-02-2006"}}</p>
+ </div>
</li>
{{ end }}
</ul>
--- /dev/null
+<ol class="crumbs" itemscope itemtype="https://schema.org/BreadcrumbList">
+ {{- /* declare a 'variable' to store the each link position */}}
+ {{- $data := newScratch }}
+
+ {{- range $index, $value := .Ancestors.Reverse }}
+ <li class="crumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
+ {{- /* read the index from loop and add 'one', because it starts counting from zero */}}
+ {{- $data.Set "counter" $index }}
+ {{- $data.Add "counter" 1 }}
+ <a itemprop="item" href="{{.Permalink}}">
+ {{ if .IsHome }}
+ <span itemprop="name">home</span>
+ {{ else }}
+ <span itemprop="name">{{.Title}}</span>
+ {{ end }}
+ </a>
+ {{- /* pass the counter value into schema attribute */}}
+ <meta itemprop="position" content='{{ $data.Get "counter"}}' />
+ </li>
+ {{- end }}
+ <li class="crumb-item active" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
+ {{- /* add 'one' one more time for the last link position */}}
+ {{- $data.Add "counter" 1 }}
+ <span itemprop="name">{{.Title}}</span>
+ {{- /* pass the counter value into schema attribute */}}
+ <meta itemprop="position" content='{{ $data.Get "counter"}}' />
+ </li>
+</ol>
\ No newline at end of file
<div id="page" class="blog-post">
<a id="top" class="skip-link screen-reader-text" href="#primary">skip to content</a>
{{- partial "header.html" . -}}
+ {{- partial "breadcrumbs.html" . -}}
<div id="content" class="site-content">
<div id="primary" class="content-area">
<main id="main" class="site-main">