Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

homepage title bug #45

Closed
jerry011235 opened this issue May 10, 2023 · 4 comments
Closed

homepage title bug #45

jerry011235 opened this issue May 10, 2023 · 4 comments

Comments

@jerry011235
Copy link

jerry011235 commented May 10, 2023

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:https://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

@hugo-sid
Copy link
Owner

hugo-sid commented May 10, 2023

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.

@hugo-sid
Copy link
Owner

Take a look at:

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

@jerry011235
Copy link
Author

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.

@hugo-sid
Copy link
Owner

hugo-sid commented May 12, 2023

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/ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants