Second content?

I have my main page template sorted, I am using {{ Content .}} for the main page text, and partials to build up other sections.

One of my sections has page specific content, a list of service areas. Is there a way of creating a second page content to list these service areas?

thanks

Have a look at headless content: Build Options | Hugo

1 Like

Thanks for that

I have managed to sort it with this code:

{{ with .Resources.ByType "page" }}
              		{{ range . }}
                  <div class="fl w-20 pa2 listareas">
              				{{.Content}}
                  </div>
              		{{ end }}
              {{ end }}

Essentially I have my content folder with 3 files

/folder
-index.md
-listarea1.md
-listarea2.md

They render into 2 lists in the page which is perfect for what I need. I think I can build the full page now without too much hassle :slight_smile:

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