Why does hugo recognise hugo.toml on mac and config.toml on debian? Does that mean the site can't be rendered on a debain system if it was built on mac?

I did a hugo new site sitename on my macos and I got a hugo.toml. Spent a few days figuring things out and then uploaded the source to github.

Clone it on debian, run hugo and viola, it complains there is no config file. The exact config which I have been modifying for. afew days just disappeared for a hugo executable on debian.

After some googling I renamed the file to config.toml and suddenly hugo could see it.

But, the problem now is the cofig that worked on mac is being invalid on debian.

Error: While parsing config: Near line 7 (last key parsed 'Menus.main'): Expected value but found '{'

baseURL = "https://abc.com/"
languageCode = "en-us"
title = "xyz"
theme = "ag"

[Menus]
main = [
    { Name = "Github", URL = "https://github.com" },
    { Name = "LinkedIn", URL = "https://www.linkedin.com/" },
    { Name = "Maths", URL = "https://maths.com/maths" },
]
[params]
description = "yuo"
copyright = "© ME"
themeColor = "theme-base-0c"


disqusShortname = "spf13"

dateFormat = "Mon Jan 2 2006"
enableGitInfo = true

[frontmatter]
lastmod = [':git', ':fileModTime']


[markup.goldmark.extensions]
KaTeX = true

I don’t know what suddenly became invalid on debian.

Here’s another thing. I have a local debian system to test and it ran fine there. It is the server debain which is complaining that my config is invalid.

What exatly is wrong here? Why the difference between mac and debain? Why the difference between debian and debian?

What is the right config here?

You are not running the same version on each platform. The ability to use the “hugo.toml” file name was added in v0.110.0.

Ok so there is definitely a difference in versions that I have got on my three systems.

So now the point becomes how do I get latest hugo on all three systems. When I try to build it from source I get the following

:~/hugo$ go install github.com/gohugoio/hugo@latest
can't load package: package github.com/gohugoio/hugo@latest: cannot find package "github.com/gohugoio/hugo@latest" in any of:
	/usr/lib/go-1.6/src/github.com/gohugoio/hugo@latest (from $GOROOT)
	/home/ubuntu/go/src/github.com/gohugoio/hugo@latest (from $GOPATH)
ubuntu@ip:~/hugo$
ubuntu@ip:~/hugo$ go install github.com/gohugoio/hugo@latest
can't load package: package github.com/gohugoio/hugo@latest: cannot find package "github.com/gohugoio/hugo@latest" in any of:
	/usr/lib/go-1.6/src/github.com/gohugoio/hugo@latest (from $GOROOT)
	/home/ubuntu/go/src/github.com/gohugoio/hugo@latest (from $GOPATH)
ubuntu@ip:~/hugo$
ubuntu@ip:~/hugo$ CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
can't load package: package github.com/gohugoio/hugo@latest: cannot find package "github.com/gohugoio/hugo@latest" in any of:
	/usr/lib/go-1.6/src/github.com/gohugoio/hugo@latest (from $GOROOT)
	/home/ubuntu/go/src/github.com/gohugoio/hugo@latest (from $GOPATH)

Why is it looking for things in my local? Shouldn’t it just go ahread and download the dependencies?

The installation instructions give you a lot of options, including downloading a prebuilt binary for each platform.

If you want to build from source, you need to follow the directions for building from source. For example:

https://gohugo.io/installation/linux/#build-from-source

And the prerequisites are really important: