turn verticalposts shortcode into partial
This commit is contained in:
parent
e115ebd7ca
commit
df671adc3a
10 changed files with 68 additions and 64 deletions
|
@ -4,17 +4,28 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- define "header" }}
|
||||
<header id="blog-header">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<p>
|
||||
<span id="blog-post-published" title="{{ i18n "blog-post-published" }} {{ .Date | time.Format "2. January 2006, 15:04 MST" }}">{{ .Date | time.Format "2. January 2006" }}</span>
|
||||
<span id="blog-post-updated" title="{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006, 15:04 MST" }}">{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006" }}</span>
|
||||
</p>
|
||||
</header>
|
||||
<header id="blog-header">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<p>
|
||||
<span
|
||||
id="blog-post-published"
|
||||
title="{{ i18n "blog-post-published" }} {{ .Date | time.Format "2. January 2006, 15:04 MST" }}"
|
||||
>
|
||||
{{ .Date | time.Format "2. January 2006" }}
|
||||
</span>
|
||||
<span
|
||||
id="blog-post-updated"
|
||||
title="{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006, 15:04 MST" }}"
|
||||
>
|
||||
{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006" }}
|
||||
</span>
|
||||
</p>
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{- define "main" }}
|
||||
<main>
|
||||
{{ .Content -}}
|
||||
{{ partial "moreposts.html" . }}
|
||||
</main>
|
||||
{{- end }}
|
||||
|
|
21
layouts/partials/moreposts.html
Normal file
21
layouts/partials/moreposts.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<section class="moreposts">
|
||||
<h2>{{ i18n "moreposts-heading" }}
|
||||
<a href="blog/"class="more">{{ i18n "moreposts-more" }}</a>
|
||||
</h2>
|
||||
<div class="moreposts-wrapper">
|
||||
{{ range first 10 (where .Site.RegularPages "Section" "blog") }}
|
||||
<a href="{{ .Permalink }}" class="post-group">
|
||||
<p class="title">{{ .Title }}</p>
|
||||
<aside class="meta" title="{{ .Date | time.Format "2 Jan 2006, 15:04 MST" }}">
|
||||
<span class="date">{{ .Date | time.Format "2. January 2006" }}</span>
|
||||
<span class="author">
|
||||
{{ with .Params.author }}
|
||||
by
|
||||
{{ end }}
|
||||
{{ .Params.author }}
|
||||
</span>
|
||||
</aside>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
|
@ -1,14 +0,0 @@
|
|||
<section class="verticalposts">
|
||||
{{ with .Get "header" }}<h2>{{ i18n . }} <a href="blog/"class="more">{{ i18n "verticalposts-more" }}</a></h2>{{ end }}
|
||||
<div class="verticalposts-wrapper">
|
||||
{{ range first 3 (where .Site.RegularPages "Section" "blog") }}
|
||||
<a href="{{ .Permalink }}" class="post-group">
|
||||
<p class="title">{{ .Title }}</p>
|
||||
<aside class="meta" title="{{ .Date | time.Format "2 Jan 2006, 15:04 MST" }}">
|
||||
<span class="date">{{ .Date | time.Format "2. January 2006" }}</span>
|
||||
<span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
|
||||
</aside>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
Loading…
Add table
Add a link
Reference in a new issue