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
parent
e78fd961ae
commit
0c21f00b67
|
@ -1,3 +1,9 @@
|
|||
///////////////////
|
||||
// //
|
||||
// MEDIAS //
|
||||
// //
|
||||
///////////////////
|
||||
|
||||
.audio,
|
||||
.stream {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.post-image {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.post-info {
|
||||
|
||||
> ul {
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<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}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
|
|
|
@ -1,17 +1,30 @@
|
|||
{{ define "main" }}
|
||||
<header class="post-header">
|
||||
{{ if .Params.postimage -}}
|
||||
<img class="post-image"
|
||||
src="/images/{{ .Params.postimage }}"
|
||||
alt="{{ .Params.postimagedescription }}">
|
||||
{{ end }}
|
||||
<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" }}
|
||||
{{- partial "post-info.html" . -}}
|
||||
{{ end }}
|
||||
</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 }}"
|
||||
{{ 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 -}}
|
||||
</article>
|
||||
{{ end -}}
|
||||
|
|
Loading…
Reference in New Issue