portfolio/layouts/_default/study.html

58 lines
1.5 KiB
HTML

{{- define "main" -}}
{{- $svg := "" -}}
{{- with .Params.hero.svg -}}
{{- $match := $.Resources.GetMatch . -}}
{{- if not $match -}}
{{- $match = $.Resources.GetMatch (printf "img/%s" .) -}}
{{- end -}}
{{- with $match -}}
{{- $svg = .Content -}}
{{- end -}}
{{- end -}}
<header>
<hgroup>
<h1>{{ with .Params.hero.title }}{{ . }}{{ else }}{{ .Title }}{{ end }}</h1>
{{- with .Params.hero.deck -}}
<p class="lede">{{ . | markdownify }}</p>
{{- end -}}
{{- if and (not .Params.hero.deck) .Summary -}}
<p class="lede">{{ .Summary | markdownify }}</p>
{{- end -}}
</hgroup>
{{- with .Params.study -}}
<aside aria-label="Study metadata">
{{- with .facts -}}
{{- range . -}}
<figure>
{{- with .icon -}}
{{ partial "icon.html" (dict "name" .) }}
{{- end -}}
<label>{{ .label }}</label>
<figcaption {{ with .class }}class='{{ . }}'{{ end }}>{{ .value | markdownify }}</figcaption>
</figure>
{{- end -}}
{{- end -}}
</aside>
{{- end -}}
{{- with $svg -}}
{{ . | safeHTML }}
{{- end -}}
</header>
<article>
{{- with .Params.study.toc -}}
<nav aria-label="Table of contents">
<ol>
{{- range . -}}
<li><a href="#{{ .id }}">{{ .label }}</a></li>
{{- end -}}
</ol>
</nav>
{{- end -}}
<div id="content">
{{ .Content }}
</div>
</article>
{{- end -}}