post image: get the image in the atom xml file

* Moves the image from the post header to the main content.
* Fixes an error in the publication date in the atom file.
* Adapts the style of the figure when it's a post image.
* Comments the single page template.

Co-Authored-by: iGor milhit <igor@milhit.ch>
pull/37/head
iGor milhit 2022-01-02 20:24:06 +01:00
parent e78fd961ae
commit 0c21f00b67
Signed by: igor
GPG Key ID: 692D97C3D0228A99
4 changed files with 37 additions and 10 deletions

View File

@ -1,3 +1,9 @@
///////////////////
// //
// MEDIAS //
// //
///////////////////
.audio, .audio,
.stream { .stream {
border: $dark-polar solid 1px; border: $dark-polar solid 1px;
@ -71,3 +77,15 @@ figure {
} }
} }
} }
.post-image {
border: none;
margin-left: 0;
padding-left: 0;
@include breakpoint(laptop) {
max-width: 97%;
margin-right: 0;
padding-right: 0;
}
}

View File

@ -10,10 +10,6 @@
} }
} }
.post-image {
width: 97%;
}
.post-info { .post-info {
> ul { > ul {

View File

@ -29,7 +29,7 @@
<item> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
<pubDate>{{ .PublishDate.Format "2006-01-02" | safeHTML }}</pubDate> <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid> <guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description> <description>{{ .Content | html }}</description>

View File

@ -1,17 +1,30 @@
{{ define "main" }} {{ define "main" }}
<header class="post-header"> <header class="post-header">
{{ if .Params.postimage -}}
<img class="post-image"
src="/images/{{ .Params.postimage }}"
alt="{{ .Params.postimagedescription }}">
{{ end }}
<h1 id="title">{{ .Title }}</h1> <h1 id="title">{{ .Title }}</h1>
<!--
If it's a static page, then the post information are useless and
therefore not displayed. The test checks if the page IS NOT a static
page.
-->
{{- if ne .Layout "static" }} {{- if ne .Layout "static" }}
{{- partial "post-info.html" . -}} {{- partial "post-info.html" . -}}
{{ end }} {{ end }}
</header> </header>
<!--
If in the front matter, the layout key is set to verse, then the class is
added.
-->
<article {{ if eq .Layout "verse" }} class="content, {{ .Layout }}" <article {{ if eq .Layout "verse" }} class="content, {{ .Layout }}"
{{ else }} class="content" {{ end -}}> {{ else }} class="content" {{ end -}}>
<!--
Displays the image associated to the post, if set in the front matter.
-->
{{ if .Params.postimage -}}
<figure class="post-image">
<img src="/images/{{ .Params.postimage }}"
alt="{{ .Params.postimagedescription }}">
</figure>
{{ end }}
{{ .Content -}} {{ .Content -}}
</article> </article>
{{ end -}} {{ end -}}