When I add files into the main content directory everything works fine. The .md post files show up, but when I put my files into the subdirectories. The {{ range (where .Pages "File.Dir" "in" "/articles/") }}
code just doesn't do anything. Nothing is showing up. I included part of my website's index.html file for a broader reference. I have an articles folder (/content/articles/) and inside there are multiple .md files. I am running Hugo on windows 10.
Thanks for your help
<div class="row" id="articles">
<div class="col-sm-12">
<h3 class="category_header">Articles</h3>
<div class="article_list card-body">
<ul>
{{ range (where .Pages "File.Dir" "in" "/articles/") }}
<li>
{{ .PublishDate.Format "Jan 2006" }} -
<a href="{{.Permalink}}">{{.Title}}</a>
</li>
{{ end }}
</ul>
</div>
</div>
</div>
Edit: I think this is related to windows paths. I re-created my website on Ubuntu and didn't have the same problem.
I can't reproduce this on my windows 10 box.
But in general, you should probably be using
{{ range .Section "articles" }}
instead.