8
layouts/_default/single.html
Normal file
8
layouts/_default/single.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
{{ partial (printf "posts/%s.html" (.Params.heroType | default "hero")) . }}
|
||||
<div class="content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
12
layouts/partials/image.html
Normal file
12
layouts/partials/image.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $path := .path -}}
|
||||
{{- $alt := .alt -}}
|
||||
{{- $caption := .caption -}}
|
||||
|
||||
{{ if $path }}
|
||||
<figure class="image">
|
||||
<img src="{{- $path | absURL -}}" {{ with $alt }}alt="{{- . -}}"{{ end }} />
|
||||
{{ with $caption }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
16
layouts/partials/posts/hero.html
Normal file
16
layouts/partials/posts/hero.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<section class="hero">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div class="meta">
|
||||
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
|
||||
·
|
||||
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
|
||||
</div>
|
||||
{{ with .Params.heroImage }}
|
||||
{{ partial "image.html" (dict
|
||||
"path" .path
|
||||
"alt" .alt
|
||||
"caption" .caption
|
||||
)
|
||||
}}
|
||||
{{ end }}
|
||||
</section>
|
Reference in New Issue
Block a user