Markdown files in content/home/*.md for page section, but not new pages or posts

I have an index.html file. I want each section to be filled in with content from different markdown files. I don’t want post/pages to be created from the markdown files. Only a simple way to fill in <div> elements in my index.html. Is Hugo the wrong tool for the job?


├── snippets/
│   ├──
│   ├──
│   ├──
│   └──

site configuration

list = 'always'
render = 'never'
path = "/snippets/**"

home page template

{{ range where site.RegularPages "Section" "snippets" }}
    {{ .Content }}
{{ end }}

Thank you! This is great, but it still creates posts. Is there a way to prevent posts from being made in a blog section?

I’m sorry but I don’t understand the question. Can you show me your content tree?

No, no. I’m certain it’s my fault for not being clear/new to Hugo.
Here is the tree.
├── about
│ └──
├── blog
│ ├──
│ └──
├── contact
│ └──
├── home
│ ├──
│ ├──
│ ├──
│ └──
├── ideas
│ └──
├── ttr
└── works
└── _index.html

Also, here’s the site. To maybe better visualize what, I’m trying to achieve.

Ok, not sure what this means.

Here. Posts are created from the snippet, but I don’t want that to occur.

I only want to fill out a page with different markdown files providing the content/filling out


I don’t want posts from these snippets to appear here:
I only want the markdown files to fill in different divs
within the page

Isnt’ that the same thing we did for the home page? I think we are failing to communicate.

I’m really sorry. This is hard to explain. I could solve this issue by adding partials to the home page, however, partials are in html and not mds. Using md’s creates, on the home page, unwanted posts on the blog page. Is there a way to add content within divs without creating these unwanted posts

With the above, the snippets are not created as HTML files when you build the site.

Site configuration is in a file called config.yaml/toml in the root, correct?

Yes. Perhaps you should share your project repository. I think it would save you some time.

Will do, but I’m not home now. Thank you for your help and patience.

I took a closer look and see that the solution you provided works, but dead links are shown in the blog section.

So, this would help.

Here it is. Thank you

On the blog page, you are listing all the regular pages on the site, regardless of section.

Change this:

{{ range .Site.RegularPages }}

To this:

{{ range .Pages }}

Thank you very much! Solved!

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