portfolio/layouts/_default/study.html

78 lines
2.2 KiB
HTML

{{- define "main" -}}
{{- $heroImage := "" -}}
{{- $heroInlineSvg := "" -}}
{{- with .Params.hero.image -}}
{{- $match := $.Resources.GetMatch . -}}
{{- if not $match -}}
{{- $match = $.Resources.GetMatch (printf "img/%s" .) -}}
{{- end -}}
{{- with $match -}}
{{- $heroImage = .RelPermalink -}}
{{- end -}}
{{- end -}}
{{- with .Params.hero.inline_svg -}}
{{- $match := $.Resources.GetMatch . -}}
{{- if not $match -}}
{{- $match = $.Resources.GetMatch (printf "img/%s" .) -}}
{{- end -}}
{{- with $match -}}
{{- $heroInlineSvg = .Content -}}
{{- end -}}
{{- end -}}
<section{{ with $heroImage }} style="--hero-image: url('{{ . }}');"{{ end }}>
<header>
{{- with .Params.hero.tags -}}
<!--<ul class="tag-list" aria-label="Case study tags">
{{- range . -}}
<li>
<span class="tag{{ with .tone }} tag-{{ . }}{{ end }}">{{ .label }}</span>
</li>
{{- end -}}
</ul>-->
{{- end -}}
<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 -}}
</header>
{{- 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 $heroInlineSvg -}}
{{ . | safeHTML }}
{{- end -}}
</section>
<article>
{{- with .Params.study.toc -}}
<nav id="toc" 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 -}}