post widget: Add optional simple listing format

See #470
This commit is contained in:
George Cushen committed 2018-04-16 02:36:20 +01:00
1 parent a5a0037c68
commit 3eb8355dc8
6 files changed
+30 -4

No files matched your search

+4
View File
@@ -20,5 +20,9 @@ tags_exclude = []
# Number of posts to list.
count = 5
# List format.
# 0 = Simple
# 1 = Detailed
list_format = 1
+++
+5 -1
View File
@@ -4,9 +4,13 @@ date = 2017-01-01
math = false
highlight = false
# List format.
# 0 = Simple
# 1 = Detailed
list_format = 1
# Optional featured image (relative to `static/img/` folder).
[header]
image = ""
caption = ""
+++
File renamed without changes.
+6
View File
@@ -0,0 +1,6 @@
{{ $post := .post }}
<div class="pub-list-item" itemscope itemprop="blogPost" itemtype="http://schema.org/BlogPosting">
<i class="fa fa-newspaper-o pub-icon" aria-hidden="true"></i>
<a href="{{ $post.Permalink }}" itemprop="url"><span itemprop="headline">{{ $post.Title }}</span></a>
</div>
+10 -2
View File
@@ -45,7 +45,11 @@
{{ $show_post := $.Scratch.Get "show_post" }}
{{ if ne $show_post "0" }}
{{ $params := dict "post" . }}
{{ partial "post_li" $params }}
{{ if eq $page.Params.list_format 0 }}
{{ partial "post_li_simple" $params }}
{{ else }}
{{ partial "post_li_detailed" $params }}
{{ end }}
{{end}}
{{ end }}
@@ -72,7 +76,11 @@
{{ $show_post := $.Scratch.Get "show_post" }}
{{ if ne $show_post "0" }}
{{ $params := dict "post" . }}
{{ partial "post_li" $params }}
{{ if eq $page.Params.list_format 0 }}
{{ partial "post_li_simple" $params }}
{{ else }}
{{ partial "post_li_detailed" $params }}
{{ end }}
{{end}}
{{ end }}
+5 -1
View File
@@ -14,7 +14,11 @@
{{ $paginator := .Paginate .Data.Pages }}
{{ range $paginator.Pages }}
{{ $params := dict "post" . }}
{{ partial "post_li" $params }}
{{ if eq $.Params.list_format 0 }}
{{ partial "post_li_simple" $params }}
{{ else }}
{{ partial "post_li_detailed" $params }}
{{ end }}
{{ end }}
{{ partial "pagination" . }}