Improve taxonomy handling
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
<section class="hero">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<div class="meta">
|
||||
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
|
||||
·
|
||||
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
|
||||
</div>
|
||||
{{ partial "components/meta/index.html" . }}
|
||||
{{ partial "components/image/index.html" (dict "page" .Page "image" .Params.hero) }}
|
||||
</section>
|
||||
|
@@ -9,8 +9,8 @@
|
||||
{{- if reflect.IsMap $image -}}
|
||||
{{- $src = $image.src | default "" -}}
|
||||
{{- $caption = $image.caption | default "" -}}
|
||||
{{- $title = $image.title | default $caption | default "" -}}
|
||||
{{- $alt = $image.alt | default $title | default "" -}}
|
||||
{{- $title = $image.title | default $caption | default "" | plainify -}}
|
||||
{{- $alt = $image.alt | default $title | default "" | plainify -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $src -}}
|
||||
@@ -34,6 +34,7 @@
|
||||
{{- $thumb = . | images.Filter (images.Process "webp q75") -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<figure class="captioned-image lightbox">
|
||||
<a
|
||||
href="{{- $full.RelPermalink -}}"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<section class="meta">
|
||||
<h1>{{ .Page.Title }}</h1>
|
||||
<section class="details">
|
||||
<h1 class="title">{{ .Page.Title }}</h1>
|
||||
<p class="length">A {{ .Kind }} with {{ len .Pages }} items</p>
|
||||
{{ .Content }}
|
||||
</section>
|
18
layouts/partials/components/meta/index.html
Normal file
18
layouts/partials/components/meta/index.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="meta">
|
||||
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
|
||||
·
|
||||
{{ if eq .Kind "page" }}
|
||||
{{ range .Params.tags }}
|
||||
<a href="/tags/{{ . | urlize }}" class="tag">{{ . }}</a>
|
||||
·
|
||||
{{ end }}
|
||||
<span class="duration">
|
||||
{{ printf "%d min. read" .ReadingTime }}
|
||||
</span>
|
||||
{{ else }}
|
||||
{{ $count := len .Pages }}
|
||||
<span class="duration">
|
||||
{{ printf "%d %s" $count (cond (eq $count 1) "item" "items") }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
@@ -1,21 +1,26 @@
|
||||
{{ $pages := .CurrentSection.Pages.ByDate.Reverse }}
|
||||
|
||||
|
||||
<div class="postnav">
|
||||
{{ with $pages.Prev . }}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<div class="previous">
|
||||
<p class="caption">Previous Post</p>
|
||||
<p class="title">{{ .Title }}</p>
|
||||
</div>
|
||||
</a>
|
||||
{{ if eq .Kind "page" }}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<div class="previous">
|
||||
<p class="caption">Previous Post</p>
|
||||
<p class="title">{{ .Title }}</p>
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with $pages.Next . }}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<div class="next">
|
||||
<p class="caption">Next Post</p>
|
||||
<p class="title">{{ .Title }}</p>
|
||||
</div>
|
||||
</a>
|
||||
{{ if eq .Kind "page" }}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<div class="next">
|
||||
<p class="caption">Next Post</p>
|
||||
<p class="title">{{ .Title }}</p>
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@@ -1,15 +1,13 @@
|
||||
<div class="list">
|
||||
{{ range sort .Pages "Date" "desc" }}
|
||||
{{ if not .Params.private }}
|
||||
<a href="{{- .RelPermalink -}}" class="post">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<div class="summary">{{ .Summary | plainify }}</div>
|
||||
<div class="meta">
|
||||
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
|
||||
·
|
||||
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="post">
|
||||
<a href="{{- .RelPermalink -}}">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<div class="summary">{{ .Summary | plainify }}</div>
|
||||
</a>
|
||||
{{ partial "components/meta/index.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user