A number of newbie layout questions

Hi,

I am completely new to using static site generators and have a few questions I couldn’t really find answers for, perhaps because I don’t quite know all the terminology yet. But here goes:

I have a website in mind where the front page, as well as a few other pages, are static. Think the following navigation structure:

  • Home
  • About
  • Blog
  • Services
  • Downloads
  • Contact

Now when I write some bogus blog posts and use the Hyde-X theme, the theme I am thinking of using, they all show up on the home page, which is not desirable.
I already noticed that the themes/themename/layouts/index.html is responsible for this. So, what I need to do I guess is move that into its own folder, like layouts/blog/index.html, and write a new index that would become my front page. Is this correct, or am I missing a step?
Also, how would I populate my sidebar properly? In the theme’s docs, it says to add the menu options to the front matter of the page, but wouldn’t that necessitate adding it to every single post and Page I make? Also, would telling it to go to /blog be sufficient to target that moved index.html?

I am sorry if these questions have been answered before, feel free to point me to other threads or posts that explain these things. I come from a mixed background between WordPress and MVC frameeworks and the way Hugo works is therefore a little new to me.

Thanks a lot in advance,
Zersiax

Did you create your content using something like hugo new blog/titleOfPost.md or just create it in the content directory? If you put it in a subdirectory under content, then Hugo will render it using that same path.

Hi,

Yes, I did use new blog/post.md, but it still shows up on the main
page. Shouldn’t it do that?

Zersiax

you are nearly right - the only mistake ist - that “blog” is a section - so you have to create a folder “section” and in there a file named “blog.html”

theme/section/blog.html

this file is responsible for the url:

yoursite/blog/

so you have to put the loop for listing all your blog-posts from the index.html into that section/blog.html

the rest is only putting the blogpost-listing logic into the “li.html” file (or list.html) which should be located in

theme/blog/list.html (or .../li.html)