雨果-多种语言支持错误

I cloned a Hugo project, but when I try to compile it I get errors like this:

function "i18n" not defined

This function is related to multilingual support. I noticed a similar situation happened here, and I tried to follow the fix, which was specified as:

go get github.com/spf13/hugo
cd $GOPATH/src/github.com/spf13/hugo
git remote add abourget git@github.com:abourget/hugo
git checkout -b multilingual abourget/master
go install -v

But this didn't work, because the branch doesn't seem to exist anymore, and I can't find any more comments about it. Does anyone know how this feature might be added?

The multilingual support is now merged into Hugo master, but not yet released. It will be in Hugo 0.17 that will, hopefully, be out in not too long.

In the meantime, you can build it yourself, and read the documentation at https://github.com/spf13/hugo/blob/master/docs/content/content/multilingual.md

As of time of writing (still 0.16.0 June 2016 release), the multilingual sites are not even released officially. But if you are asking, can this feature — multilingual sites — be added, yes it can.

Here's how.

You can set up multilingual sites using two separate Hugo builds (in a folder and its subfolder) and I successfully set two sites on one domain (root is EN and in the root I have /LT/ folder which houses the site in another language).

Basically, use this tutorial: http://gohugo.io/tutorials/create-a-multilingual-site/

There are few caveats, which I covered in my answer on other S.O. question about multilingual sites: https://stackoverflow.com/a/37514883/3943954

In short, official tutorial at Hugo website implies you should use two different domains for each language, but I managed to cram both into one. This will require some hacks to support static pages — setup will require you to have some build system which is capable to remove one redundant level of folders if you use static landing pages (I'm using npm scripts):

"restorefolders": "rsync -a public/lt/lt/ public/lt/ && rm -rf public/lt/lt/",

Hope it helps.