How to render multiple root level html pages

Hi everyone I’m fairly new to Hugo and I have been reading docs for few days, forums as well. I have few questions mainly related to unique page rendering at root level.

For example layouts directory has rule that renders index.html which means it treats it specially. What would be the process of rendering about.html that uses content from partials folder. But with its unique content.

My main goal is to have shows rendered index.html and renders blog.html and i have managed to pull exactly that using approach from this post. I was wondering is there a better approach to this problem.

Thanks in advance, sorry for kinda noobish question but i’m still warpping my head around this.

Create two content files:

1. content/
2. content/

Create two layouts, which will render the respective pages above:

1. layouts/index.html
2. layouts/_default/single.html

To pay me back, read the site the team is working on to improve the docs and provide feedback :wink:


@rdwatters Much obliged, it is elegant solution. I will be checking out and contributing however i can to docs you provided.

Thanks again.

1 Like

For a slightly different way of doing this you can take a look at a couple sites I built.

I think they will contain example of what you are wanting to do.

I have a similar problem/requirement (the same, in fact).

I have followed the advice given here, but it does not render my or When I point my browser to /about or /contact it gives me a 404 error.

If I create about.html or contact.html, that will get rendered, but that is not what I want.

What is supposed to be in my content/

My layouts/_default/single.html contains just the following:

{{ define "main" }}

<div class="panel panel-default">
    <div class="panel-heading">
        <h1>{{ .Title }}</h1>
    <div class="panel-body">
        {{ .Content }}

{{ end }} 

Never mind. It seems I eventually came right. It seems that the is not required, right?

In the end, I had accidentally changed the date in my front matter to a future date while copying the front matter from another page…

It’s not required.