Merge pull request #305 from mckmonster/add_image_onlistpage
To have the same display on each pages
This commit is contained in:
commit
f91ebeae6b
3 changed files with 39 additions and 66 deletions
|
@ -9,38 +9,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="posts-list">
|
<div class="posts-list">
|
||||||
{{ range .Paginator.Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
<article class="post-preview">
|
{{ partial "post_preview.html" .}}
|
||||||
<a href="{{ .Permalink }}">
|
|
||||||
<h2 class="post-title">{{ .Title }}</h2>
|
|
||||||
|
|
||||||
{{ if .Params.subtitle }}
|
|
||||||
<h3 class="post-subtitle">
|
|
||||||
{{ .Params.subtitle }}
|
|
||||||
</h3>
|
|
||||||
{{ end }}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<p class="post-meta">
|
|
||||||
{{ partial "post_meta.html" . }}
|
|
||||||
</p>
|
|
||||||
<div class="post-entry">
|
|
||||||
{{ if .Truncated }}
|
|
||||||
{{ .Summary }}
|
|
||||||
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
|
|
||||||
{{ else }}
|
|
||||||
{{ .Content }}
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{ if .Params.tags }}
|
|
||||||
<div class="blog-tags">
|
|
||||||
{{ range .Params.tags }}
|
|
||||||
<a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
|
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
|
||||||
|
|
|
@ -11,40 +11,7 @@
|
||||||
<div class="posts-list">
|
<div class="posts-list">
|
||||||
{{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
|
{{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
|
||||||
{{ range $pag.Pages }}
|
{{ range $pag.Pages }}
|
||||||
<article class="post-preview">
|
{{ partial "post_preview" . }}
|
||||||
<a href="{{ .Permalink }}">
|
|
||||||
<h2 class="post-title">{{ .Title }}</h2>
|
|
||||||
{{ if .Params.subtitle }}
|
|
||||||
<h3 class="post-subtitle">
|
|
||||||
{{ .Params.subtitle }}
|
|
||||||
</h3>
|
|
||||||
{{ end }}
|
|
||||||
{{ if .Params.image }}
|
|
||||||
<img src="{{ .Params.image }}" alt="{{ .Title }}" class="img-title" />
|
|
||||||
{{ end }}
|
|
||||||
{{ if .Params.video }}
|
|
||||||
<video src="{{ .Params.video }}" loop autoplay muted playsinline class="img-title" />
|
|
||||||
{{ end }}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{{ partial "post_meta.html" . }}
|
|
||||||
<div class="post-entry">
|
|
||||||
{{ if .Truncated }}
|
|
||||||
{{ if .Params.summary }}{{ .Params.summary }}{{ else }}{{ .Summary }}{{ end }}
|
|
||||||
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
|
|
||||||
{{ else }}
|
|
||||||
{{ .Content }}
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{ if .Params.tags }}
|
|
||||||
<div class="blog-tags">
|
|
||||||
{{ range .Params.tags }}
|
|
||||||
<a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
37
layouts/partials/post_preview.html
Normal file
37
layouts/partials/post_preview.html
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<article class="post-preview">
|
||||||
|
<a href="{{ .Permalink }}">
|
||||||
|
<h2 class="post-title">{{ .Title }}</h2>
|
||||||
|
{{ if .Params.subtitle }}
|
||||||
|
<h3 class="post-subtitle">
|
||||||
|
{{ .Params.subtitle }}
|
||||||
|
</h3>
|
||||||
|
{{ end }}
|
||||||
|
{{ if .Params.image }}
|
||||||
|
<img src="{{ .Params.image }}" alt="{{ .Title }}" class="img-title" />
|
||||||
|
{{ end }}
|
||||||
|
{{ if .Params.video }}
|
||||||
|
<video src="{{ .Params.video }}" loop autoplay muted playsinline class="img-title" />
|
||||||
|
{{ end }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<p class="post-meta">
|
||||||
|
{{ partial "post_meta.html" . }}
|
||||||
|
</p>
|
||||||
|
<div class="post-entry">
|
||||||
|
{{ if .Truncated }}
|
||||||
|
{{ .Summary }}
|
||||||
|
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
|
||||||
|
{{ else }}
|
||||||
|
{{ .Content }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ if .Params.tags }}
|
||||||
|
<div class="blog-tags">
|
||||||
|
{{ range .Params.tags }}
|
||||||
|
<a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
</article>
|
Loading…
Add table
Add a link
Reference in a new issue