I’m having a problem with combining content from two sections on one page. For some reason, the exact same code does works just fine when used on the homepage, but it doesn’t work on any other pages. Your help is much appreciated! Thank you!
content
content / conf
--- _index.md
content / previous
--- 2017.md
--- 2016.md
content / current
--- 2018.md
+++
date = "2018-11-24T23:49:24+00:00"
layout = "page"
showdate = false
title = "Conferences"
+++
_layouts
_layouts/conf/list.html
:
{{ define "main" -}}
<h6>Upcoming conferences</h6>
<div class="posts">
{{ range where .Data.Pages "Section" "current" -}}
<article class="post">
{{ .Title }}
{{ .Summary }}
</article>
{{- end }}
</div>
<h6>Previous conferences</h6>
<div class="posts">
{{ range first 10 (where .Data.Pages "Section" "previous") -}}
<article class="post">
{{ .Title }}
{{ .Summary }}
</article>
{{- end }}
</div>
{{- end }}
For some reason, the exact same code works just fine on _layouts/conf/index.html
but it doesn’t work on any custom layouts.