Custom start page with hugo

I am doing a very basic hugo site but I want a custom homepage.

I created my folder structure like this

content
…/post
…/post_a
…/post_b
…/post_c
…/page
…/home
…/about
…/blog

Now I am able to get my homepage, blog and about page to show up on the menu but I would like when users land on my domain: localhost:1313 it to show the home.md file
when they click on blog to go to localhost:1313/blog
when they click on about to go to localhost:1313/about

as it stands now when they arrive they go to the to the root domain which shows the list of blog posts. How can I switch this to have them always have home.md be the start page?

Also I read the docs and it seems hugo likes the structure the url based on the folder structure but I would like cleaner URL

that means instead of localhost/post/post-title
could I just have hugo drop the /post/ without have to manually add something to the top matter of each post.md that I create?

The home page is not a content, it’s a node. See templates/homepage in the doc.
You should delete page/home.md and use a template file. If you are using a theme with a default layout for the home page, you can override it by placing your template in layouts/index.html.

You might be interested in issue 720.

Thanks for the tip. I created a index.html and wrote the html that works. I created a menu item like this

[[menu.main]]
    name = "Home"
    url = "/"
    weight = 1

[[menu.main]]  //confused here
    name = "Blog"
    url = "/"
    weight = 2

[[menu.main]]
    name = "About"
    url = "/about/"
    weight = 3

I am a bit confused now as how to setup my blog roll at another url? How do I put the blogroll on another page and set the url inside my config file?

Search for paginator in the docs. I put a subset of my posts on my front page like this:

If you’re talking about another site, a different domain, you can do it via RSS and javascript. Your blog produces RSS, and you consume that feed with javascript and display it.

@RickCogley thanks for the info on the paginator. Looking at the documents it seems like paginators can only be used on temples, okay I can work with that. This info actually helps so it can make my homepage a bit more dynamic by pulling in the last 3 post from each category or something like that.

Here’s the last bit that I am confused on now. I have index.html which is the homepage of my hugo site, it has to be a template file written in html. Okay that part is done.

Looking at the template documentation there’s three basic types of templates; single, list, homepage.

Now I create another template where I want my paginator to show all my blog posts. Let’s say I create a new template called journal.html that will serve as the page where all my blog posts show up.

Since my homepage is custom, creating a new template to serve as my blog roll, how do i assign a url to that template so that for instance going to:

domain.com = custom homepage template
domain.com/journal = a paginated list of posts

The reason this confuses me is because I can’t use a .md document to host all my blog posts and I am not sure how to apply url’s to template files.

My second question was answered by this post

Hugo definitely rocks!

1 Like