Range where not loading pages on load


I am having a strange issue with loading pages using “Range”

    <div class="row section-container justify-content-center">
      {{ range where .Site.Pages "Params.category" "research" }}
        {{ partial "research-card" .}}
      {{ end }}

The code above is used to create cards using the pages that have the category = “research”.

The issue I am having is that when I run hugo and then hugo server it does not load the pages, if I open the page and save it then suddenly the card appears, if I restart the local web server it once again displays nothing until I once again manually save each page.

This is an example of my md file:

title: "Research Title"
date: 2022-11-24
description:             Lorem ipsum dolor sit amet consectetur. Tempor nibh viverra neque
            amet eu justo condimentum. Volutpat nisl rutrum nascetur nisl neque
            amet morbi. Sem leo aliquet nam nascetur sagittis a massa erat sed.
draft: false
category: research
readtime: 5 min read


Ac ut consequat semper viverra nam. Hac habitasse platea dictumst vestibulum 
rhoncus. Amet porttitor eget dolor morbi non. Justo eget magna fermentum 
iaculis eu non. Id eu nisl nunc mi ipsum faucibus vitae aliquet nec. Aliquam 
id diam maecenas ultricies. Non sodales neque sodales ut etiam. Amet massa 
vitae tortor condimentum lacinia quis. Erat imperdiet sed euismod nisi porta. 
Nisl suscipit adipiscing bibendum est ultricies integer quis auctor. Viverra 
suspendisse potenti nullam ac. Tincidunt id aliquet risus feugiat in. Varius 
quam quisque id diam vel. Egestas erat imperdiet sed euismod nisi. Scelerisque 
felis imperdiet proin fermentum leo vel orci porta non. Ut faucibus pulvinar 
elementum integer. Fermentum odio eu feugiat pretium nibh ipsum consequat nisl.

I am making sure to fully save the entire project before running however that doesnt seem to affect it.

Do you see any messages when you run:

hugo --printPathWarnings 

Once again you are a hero!

Running the command you sent printed the following: “WARN 2022/12/07 03:06:19 Duplicate target paths: \index.html (2)”

I checked for index.html files and seems I added a duplicate, removing it fixed the issues and they load correctly now.

Apologies for the silly mistake and thanks for the help!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.