Can I localize md files by Json or toml

I’m thinking of using Hugo Generator to create offline documents.

I learned that Hugo supports multiple languages by adding an language code to files.

In this case, it is troublesome because the layout must be written for each page.

My ideal is to put language data together in a json file and refer to it in the same .md file like this.


title: “First Page”

# {{hello}}

“hello”: “Hello”

“hello”: “こんにちは”

Of course, this is “ideal” and will not actually work. Is there a similar way to describe this in Hugo?

you can do it the way hugo is built on :

and a great article

Thank you for your replying.

I created language files in the data folder according to the document, but the text is not replaced and is output as it is.

 ├ data/
 │  ├ test.en.json
 │  └ test.ja.json
 ├ content/
 │ └ posts/
 │   └
# test 

{{ .Site.Data.test[.Site.Language.Lang].hello }}
{{ .Site.Data.test.en.hello }}

This is a test page.

Have a look at my repo, where I’ve done this, e.g. for a carousel on the home page:

I thought Hugo doesn’t supported in current version. So I’ll copy md files in a batch file.