Don't generate empty div.post__meta
This commit is contained in:
parent
228a06dc5f
commit
6f847bd6d1
3 changed files with 10 additions and 8 deletions
|
@ -3,7 +3,7 @@
|
|||
<div class="single block">
|
||||
<article class="post">
|
||||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
||||
<div class="post__meta meta mb">{{ partial "post_meta.html" . }}</div>
|
||||
{{- partial "post_meta.html" (dict "dot" . "class" "mb") }}
|
||||
<h1 class="post__title">{{ .Title }}</h1>
|
||||
{{- partial "post_toc.html" . }}
|
||||
<div class="post__content">{{ .Content }}</div>
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
{{- partial "post_thumbnail.html" (dict "page" . ) }}
|
||||
<h1 class="post__title title-excerpt"><a class="post__title-link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
|
||||
<div class="post__content">{{- .Summary }}</div>
|
||||
<div class="post__meta meta mt tar">{{ partial "post_meta.html" . }}</div>
|
||||
{{- partial "post_meta.html" (dict "dot" . "class" "mt tar") }}
|
||||
</article>
|
|
@ -1,7 +1,9 @@
|
|||
{{ $currentPage := . }}
|
||||
{{- with .Param "post_meta" }}
|
||||
{{- range $metaField := . -}}
|
||||
{{- $metaFieldPath := printf "post_meta/%s.html" $metaField -}}
|
||||
{{- partial $metaFieldPath $currentPage -}}
|
||||
{{ end }}
|
||||
{{ $currentPage := .dot }}
|
||||
{{- if .dot.Param "post_meta" }}
|
||||
<div class="post__meta meta {{ .class }}">
|
||||
{{- range $metaField := .dot.Param "post_meta" -}}
|
||||
{{- $metaFieldPath := printf "post_meta/%s.html" $metaField -}}
|
||||
{{- partial $metaFieldPath $currentPage -}}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
Loading…
Reference in a new issue