Skip to content

Commit

Permalink
Fixed issue with empty pages and pagegroup type conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
natarajmb committed Oct 17, 2018
1 parent 62597a5 commit b89097a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
62 changes: 32 additions & 30 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
<!-- same as index.html for tags listing -->
<div class="container">
{{ partial "header" . }}
{{ partial "nav" . }}
<main class="container">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups}}
<h1 class="title is-3">{{ .Key }}</h1>
{{ range where .Pages "Section" "posts" }}
<article class="columns">
<div class="column is-2">
<h6 class="is-inline" style="white-space: nowrap">{{ .Date.Format "Jan 2" }}</h2>
{{ partial "header" . }}
{{ partial "nav" . }}
<main class="container">
{{ if .Pages }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups}}
<h1 class="title is-3">{{ .Key }}</h1>
{{ range where .Pages "Section" "posts" }}
<article class="columns">
<div class="column is-2">
<h6 class="is-inline" style="white-space: nowrap">{{ .Date.Format "Jan 2" }}</h2>
</div>
<div class="column">
<h2 class="subtitle is-inline is-size-4-mobile is-size-3-desktop"><a href="{{ .Permalink }}">{{ .Title }}</a>{{ if .Draft }} ::Draft{{ end }}</h1>
<div class="content is-hidden-mobile">
{{ .Summary | plainify | safeHTML | truncate 400 }}
{{ if .Truncated }}
<br>
<a class="button is-marginless is-paddingless" href="{{ .Permalink }}">
<span class="icon-link is-small" style="line-height: 100%">
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</span>
<p style="padding:0 5px"></p>more</p>
</a>
{{ end }}
</div>
<div class="column">
<h2 class="subtitle is-inline is-size-4-mobile is-size-3-desktop"><a href="{{ .Permalink }}">{{ .Title }}</a>{{ if .Draft }} ::Draft{{ end }}</h1>
<div class="content is-hidden-mobile">
{{ .Summary | plainify | safeHTML | truncate 400 }}
{{ if .Truncated }}
<br>
<a class="button is-marginless is-paddingless" href="{{ .Permalink }}">
<span class="icon-link is-small" style="line-height: 100%">
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</span>
<p style="padding:0 5px"></p>more</p>
</a>
{{ end }}
</div>
</article>
{{ end }}
{{ end }}
</main>
{{ partial "pager" . }}
{{ partial "footer" . }}
</div>
</article>
{{ end }}
{{ end }}
{{ end }}
</main>
{{ partial "pager" . }}
{{ partial "footer" . }}
</div>
2 changes: 2 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{{ partial "header" . }}
{{ partial "nav" . }}
<main class="container">
{{ if .Pages }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups}}
<h1 class="title is-3">{{ .Key }}</h1>
{{ range where .Pages "Section" "posts" }}
Expand All @@ -26,6 +27,7 @@ <h2 class="subtitle is-inline is-size-4-mobile is-size-3-desktop"><a href="{{ .P
</article>
{{ end }}
{{ end }}
{{ end }}
</main>
{{ partial "pager" . }}
{{ partial "footer" . }}
Expand Down

0 comments on commit b89097a

Please sign in to comment.