hugo-theme-cybercards/layouts/_default/single.html

68 lines
2.1 KiB
HTML

{{ define "main" -}}
{{- $showChildren := .Param "showChildArticles" -}}
{{- $children := slice -}}
{{- if $showChildren -}}
{{- $children = .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}}
{{- end -}}
<div class="row">
{{- $mainwidth := or (and .Params.noSidebar "12") "8" -}}
<div class="col-md-{{ $mainwidth }}">
<article class="card mt-3 mb-3"
itemscope itemtype="http://schema.org/BlogPosting">
{{ if .Title -}}
<header class="post-header card-header">
<h2 class="post-title" itemprop="name headline">{{ .Title }}</h2>
{{ 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>
{{ with .Params.Author -}} •
<span itemprop="author" itemscope
itemtype="http://schema.org/Person">
<span itemprop="name">{{ . }}</span></span>
{{- end }}
</p>
{{- end }}
</header>
{{- end }}
{{ with .Content -}}
<div class="post-content card-body" itemprop="articleBody">{{ . }}</div>
{{- end }}
{{- if eq $showChildren "embed" -}}
{{ range sort (sort $children "Date" "desc") "Weight" }}
{{ partial "embed" . }}
{{ end }}
{{- end -}}
</article>
</div>
{{ if not .Params.noSidebar -}}
{{ partial "sidebar.html" . }}
{{- end }}
</div>
{{- if eq $showChildren "cards" -}}
<div class="row">
{{ range sort (sort $children "Date" "desc") "Weight" }}
{{ partial "card.html" . }}
{{ end }}
</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 }}">&laquo; {{ .Title }}</a></li>
{{ end }}
{{ with .PrevInSection }}
<li class="page-item">
<a class="previous page-link"
href="{{ .Permalink }}">{{ .Title }} &raquo;</a></li>
{{ end }}
</ul>
</div>
</div>
{{- end }}