added config, front matter settings: nodate; show children as cards
This commit is contained in:
parent
eaafe3f1ea
commit
4257e09d9e
3 changed files with 36 additions and 27 deletions
|
@ -1,12 +1,12 @@
|
|||
{{ define "main" }}
|
||||
{{ define "main" -}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-8">
|
||||
<article class="card mt-3 mb-3"
|
||||
itemscope itemtype="http://schema.org/BlogPosting">
|
||||
|
||||
<header class="post-header card-header">
|
||||
<h2 class="post-title" itemprop="name headline">{{ .Title }}</h2>
|
||||
{{ if .Date -}}
|
||||
{{ if and (not .Params.nodate) .Date -}}
|
||||
<p class="post-meta">
|
||||
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'
|
||||
itemprop="datePublished">{{ .Date.Format (i18n "dateFormat") }}</time>
|
||||
|
@ -18,32 +18,40 @@
|
|||
</p>
|
||||
{{- end }}
|
||||
</header>
|
||||
|
||||
<div class="post-content card-body" itemprop="articleBody">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ul class="pagination">
|
||||
{{ with .NextInSection }}
|
||||
<li class="page-item">
|
||||
<a class="next page-link" href="{{ .Permalink }}">« {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ with .PrevInSection }}
|
||||
<li class="page-item">
|
||||
<a class="previous page-link"
|
||||
href="{{ .Permalink }}">{{ .Title }} »</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ partial "sidebar.html" . }}
|
||||
</div>
|
||||
|
||||
{{ partial "sidebar.html" . }}
|
||||
|
||||
{{ if and (not .Site.Params.hideChildArticles)
|
||||
(eq .Site.Params.showChildArticles "cards") -}}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{- $related := .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}}
|
||||
{{ range $related }}
|
||||
{{ partial "card.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ul class="pagination">
|
||||
{{ with .NextInSection }}
|
||||
<li class="page-item">
|
||||
<a class="next page-link" href="{{ .Permalink }}">« {{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ with .PrevInSection }}
|
||||
<li class="page-item">
|
||||
<a class="previous page-link"
|
||||
href="{{ .Permalink }}">{{ .Title }} »</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{- end }}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<div class="card-body">
|
||||
<span class="card-title h4">{{ .Title | truncate 25 }}</span>
|
||||
{{ if .Date -}}
|
||||
{{ if and (not .Params.nodate) .Date -}}
|
||||
<span class="post-meta pull-right">
|
||||
<small>{{ .Date.Format (i18n "dateFormat") }}</small></span>
|
||||
{{- end }}
|
||||
|
|
|
@ -42,7 +42,8 @@
|
|||
(dict "related" $related "header" (i18n "parent-articles") "id" "parents") -}}
|
||||
{{- end }}
|
||||
|
||||
{{ if not .Site.Params.hideChildArticles -}}
|
||||
{{ if and (not .Site.Params.hideChildArticles)
|
||||
(ne .Site.Params.showChildArticles "cards") -}}
|
||||
{{- $related := .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}}
|
||||
{{- partial "card-related"
|
||||
(dict "related" $related "header" (i18n "child-articles") "id" "children") -}}
|
||||
|
|
Loading…
Add table
Reference in a new issue