move rendering of main content to new partial 'content'
This commit is contained in:
parent
d2d1c29e2d
commit
d8db1dbddf
3 changed files with 25 additions and 42 deletions
|
@ -10,26 +10,8 @@
|
||||||
<div class="col-md-{{ $mainwidth }}">
|
<div class="col-md-{{ $mainwidth }}">
|
||||||
<article class="card mt-3 mb-3"
|
<article class="card mt-3 mb-3"
|
||||||
itemscope itemtype="http://schema.org/BlogPosting">
|
itemscope itemtype="http://schema.org/BlogPosting">
|
||||||
{{ if .Title -}}
|
{{- partial "content" . -}}
|
||||||
<header class="post-header card-header">
|
{{- if eq $showChildren "embed" -}}
|
||||||
<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" }}
|
{{ range sort (sort $children "Date" "desc") "Weight" }}
|
||||||
{{ partial "embed" . }}
|
{{ partial "embed" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -5,28 +5,9 @@
|
||||||
<div class="col-md-{{ $mainwidth }}">
|
<div class="col-md-{{ $mainwidth }}">
|
||||||
<article class="card mt-3 mb-3"
|
<article class="card mt-3 mb-3"
|
||||||
itemscope itemtype="http://schema.org/BlogPosting">
|
itemscope itemtype="http://schema.org/BlogPosting">
|
||||||
{{ if .Title -}}
|
{{- partial "content" . -}}
|
||||||
<header class="post-header card-header">
|
{{- $children := .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}}
|
||||||
<h2 class="post-title" itemprop="name headline">{{ .Title }}</h2>
|
{{ range sort (sort $children "Date" "desc") "Weight" }}
|
||||||
{{ 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 }}
|
|
||||||
|
|
||||||
{{- $related := .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}}
|
|
||||||
{{ range sort (sort $related "Date" "desc") "Weight" }}
|
|
||||||
{{ partial "embed" . }}
|
{{ partial "embed" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
20
layouts/partials/content.html
Normal file
20
layouts/partials/content.html
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{{ 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 }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue