Hugo server says `panic: Too many homes`

I have a _index.md for my home page, and I added i18n support by:

hugo add _index.zh.md

which creates _index.zh.md in the same content folder as _index.md, then it complains:

panic: Too many homes

I guess this is not the right way to add i18n support for home page, but I thought this is what the Hugo tutorial said?

Your description is missing some pieces of information – so a link to a failing site (GitHub?) would be a good start.

Hi my site is here:

http://www.huiimy.ninja

I have content/_index.md for the text displayed on home page, and I want to add a Chinese version of it, so I did:

hugo new _index.zh.md

(I’ve also defined the language code in config.toml)

however when I run hugo server -D it complains about too many homes, I guess I can only have a single content/_index.md for the home page, rather than having multi-lingual versions of it?

Your SOURCE.

Hi thanks! This is the content of content/_index.md:

---
title: "Huiimy"
date: 2017-11-05T08:57:48+11:00
draft: false
---

# Hui is my ninja
_Thoughts, flow far away and return on the wind of morning._

This is my personal website, it's newly generated by [Hugo](https://gohugo.io/) and I'll put up content soon.

But I don’t think it’s relevant, it works until I added another index to the content folder:

hugo new index.zh.md

Then it starts complaining too many homes

And below is the i18n part in config.toml:

## i18n

[language.zh]
    languageCode = "zh-cn"

[[language.zh.menu.main]]
    name = "主页"
    url = "/"
    weight = 1
[[language.zh.menu.main]]
    name = "关于"
    url = "/about/"
    weight = 2
[[language.zh.menu.main]]
    name = "手机应用"
    url = "/apps/"
    weight = 3
[[language.zh.menu.main]]
    name = "诗词"
    url = "/poems/"
    weight = 4
[[language.zh.menu.main]]
    name = "文章"
    url = "/article"
    weight = 5
[[language.zh.menu.main]]
    name = "分类"
    url = "/categories/"
    weight = 6
[[language.zh.menu.main]]
    name = "标签"
    url = "/tags/"
    weight = 7
[[language.zh.menu.main]]
    name = "English"
    url = "../en"
    weight = 8

OK,

Without the full source I have do revert to guessing.

We should deliver a better error message in this case, but you have

  • 1 language defined in config.toml.
  • 2 _Index.md home page content files.

Which creates the panic.

@bep
I would like your opinion on that :slight_smile:

I had this message too
with: Hugo Static Site Generator v0.33 linux/amd64

I think It was cause because I had multiple times define title and description
it was as usual in config.toml
than I start the translation by adding the same variables in l18n/en.yaml and l18n/fr.yaml than the issue appear.

I think it I resolved it by simply removing the variable inside config.toml and manage them only through the translation (in the directory ./l18n/*)

it is make sense ?