Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
Fix missing content with new Hugo. (#2311)
Browse files Browse the repository at this point in the history
It seems with newer Hugo the main page needs to use `.Site.Pages`
instead of `.Pages` in order for the page content to show up.

This seems to also pull in the folder as a data item, it's fine for the
products as they have an `onhomepage` filter. For the blog posts I added
in a filter to make sure there was a `processed` tag in order to filter
out the folder.

Issue #2052
  • Loading branch information
dan sinclair authored Jun 3, 2021
1 parent cc3b055 commit ce1d0c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>

<div class='row equal'>
{{ $posts := where .Pages ".Section" "==" "products" }}
{{ $posts := where .Site.Pages ".Section" "==" "products" }}
{{ $homepage := where $posts ".Params.onhomepage" true }}
{{ range $idx, $post := first 4 $homepage }}
{{ if and (ne $idx 0) (eq (mod $idx 2) 0) }}
Expand Down Expand Up @@ -87,7 +87,8 @@ <h2>{{i18n "featured-post" }}</h2>
</div>
</div>
<div class="row blog-posts">
{{ $posts := where .Pages "Section" "blog" }}
{{ $p := where .Site.Pages "Section" "==" "blog" }}
{{ $posts := where $p ".Params.author" "!=" nil }}
{{ range first 3 $posts }}
<div class="col-xs-12 col-md-4">
<div class='post'>
Expand Down

0 comments on commit ce1d0c4

Please sign in to comment.