hugo-sid/hugo-blog-awesome

homepage title bug

Closed this issue · 4 comments

Describe the bug
The homepage title seems to be duplicated.

Steps to reproduce
Steps to reproduce the behavior:
What I did:

  1. install hugo.
  2. run the following command:
hugo new site myblog
cd myblog

Get the latest version of the theme:

git clone --depth=1 https://github.com/hugo-sid/hugo-blog-awesome.git themes/hugo-blog-awesome
  1. Delete the original file myblog\config.toml, copy myblog\themes\hugo-blog-awesome\exampleSite\config.toml to the myblog folder.
  2. No other code changes, directly run hugo server.
    My blog is running successfully on http://localhost:1313 .

Look up the title of the home page,It shows Awesome Hugo blog | Awesome Hugo blog.
html source code:

<title itemprop="name">Awesome Hugo blog | Awesome Hugo blog</title>

Expected behavior
I don't think this is the correct title,the correct title should be Home | Awesome Hugo blog

Can you add file myblog/content/_index.md, with the following content?

---
title: "Home"
---

Can you try running hugo server now, and check the title? Let me know if this works for you.

Take a look at:

---
title: "Home"
author : "Hugo Authors"
---

Thanks! Problem solved!
Can you briefly explain why? Because I found that some other hugo themes do not have the _index.md file in content folder.

Hi @jerry011235.

Thanks! Problem solved!

Happy to hear that. You're most welcome.

Reason

Let me explain in simple terms. For every blog post, the title is specified in the frontmatter (shown below) of the corresponding markdown file.

---
title = "Post title"
date = ""
# so on
---

For the homepage, the frontmatter is specified in content/_index.md.

More info

This is related to the branch bundle concept of Hugo. You can read more about it here: https://gohugo.io/content-management/page-bundles/ .