[FEATURE] Blog: make the blog posts looks much nicer and add a header image
This commit is contained in:
parent
abf85cec0f
commit
2710137012
6 changed files with 69 additions and 16 deletions
|
@ -1,13 +1,13 @@
|
|||
|
||||
<article>
|
||||
<article class="blog">
|
||||
{{- partial "blog-header.html" (dict "headingLink" true "level" 2 "page" . ) }}
|
||||
|
||||
{{- if in .RawContent "<!--more-->" }}
|
||||
<section>
|
||||
{{- if in .RawContent "<!--more--> " }}
|
||||
{{ .Summary | safeHTML }}
|
||||
{{- else }}
|
||||
{{- else }}
|
||||
<p>{{ .Summary | safeHTML }}</p>
|
||||
{{- end }}
|
||||
{{- if .Truncated }}
|
||||
{{- end }}
|
||||
{{- if .Truncated }}
|
||||
<div class="morelink"><a href="{{ .RelPermalink }}">mehr...</a></div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{{ define "main" }}
|
||||
<main class="container" aria-role="main">
|
||||
<main class="container" aria-role="main">
|
||||
<article class="blog">
|
||||
{{- partial "blog-header.html" (dict "page" . ) }}
|
||||
|
||||
<section class="content">
|
||||
<section>
|
||||
{{ .Content }}
|
||||
</section>
|
||||
|
||||
|
@ -14,5 +15,6 @@
|
|||
<small class="li-comma">letzte Änderung: {{ .Format "2006-01-02 15:04" }}</small>
|
||||
{{- end }}
|
||||
</div>
|
||||
</main>
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{- $showAuthors := not (.reduced | default false) -}}
|
||||
|
||||
{{ with $page }}
|
||||
<header>
|
||||
<header class="blog-header">
|
||||
{{- if $headingLink }}<a href="{{ .RelPermalink }}">{{ end }}
|
||||
<h{{ $level }}>{{ .Title }}</h{{ $level }}>
|
||||
{{- if $headingLink }}</a>{{ end }}
|
||||
|
@ -38,5 +38,6 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ if isset .Params "header" }} <img class="container" src="{{ .Params.header.image }}" alt="{{ .Params.header.caption }}" /> {{ end }}
|
||||
</header>
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue