My first theme, pages not compiling

I am new to Hugo and I am attempting to build my first theme. When I run “hugo -D” the site renders/compiles, but none of the pages I have in my ./content folder get turned into html files.

The index page get compiled, and lists the individual page titles correctly, and makes the links I thought it would. The list html files get built correctly, too.

I changed the “draft: true” line to “draft: false”, and still no pages were built. Then I removed the draft line altogether. Still no pages.

I downoaded a theme and set the config.toml to that new theme, and everything compiled correctly, The html files were generated for the files in ./content.

I went through and compared the theme.toml files of the two themes, and nothing popped out as being different in mine, aside from the names. The only thing that has changes in my config.toml file is the name of the theme.

I am at a loss to know even where to look at this point to find out why those pages aren’t being created.

Any thoughts on where I should start?

Can you share the structure of your layouts/ directory?

You need to have at least the default layouts for your theme. Relative to your theme directory (or site directory), those will be located here:

layouts/_default/single.html
layouts/_default/list.html

Thanks, that was the push I needed.

The tutorial I was following said to make a single.html in the main layouts directory. I copied the contents of the single.html I had made in the to the empty single.html that hugo had created in the layouts/_default directory. Now it’s building everything as expected.

1 Like