IsMultiLingual
Syntax
SITE.IsMultiLingual
Returns
bool
站点配置:
hugo.
defaultContentLanguage: de
defaultContentLanguageInSubdir: true
languages:
de:
languageCode: de-DE
languageName: 德语
title: 项目文档
weight: 1
en:
languageCode: en-US
languageName: 英语
title: 项目文档
weight: 2
defaultContentLanguage = 'de'
defaultContentLanguageInSubdir = true
[languages]
[languages.de]
languageCode = 'de-DE'
languageName = '德语'
title = '项目文档'
weight = 1
[languages.en]
languageCode = 'en-US'
languageName = '英语'
title = '项目文档'
weight = 2
{
"defaultContentLanguage": "de",
"defaultContentLanguageInSubdir": true,
"languages": {
"de": {
"languageCode": "de-DE",
"languageName": "德语",
"title": "项目文档",
"weight": 1
},
"en": {
"languageCode": "en-US",
"languageName": "英语",
"title": "项目文档",
"weight": 2
}
}
}
模板:
{{ .Site.IsMultiLingual }} → true