matcornic / hugo-theme-learn

Porting Grav Learn theme to Hugo
https://learn.netlify.com/en/
MIT License
1.6k stars 1.28k forks source link

How to implement multi-language on the homepage? If you directly use the language to determine the static resource path, an error will be reported. #491

Closed misitebao closed 2 years ago

misitebao commented 3 years ago

Multi-language configuration, the content page is completely normal without any problems, but there is a problem with the home page, what do I need to do?

config.toml:

[Languages]
[Languages.en]
title = "Wails"
weight = 2
languageName = "English"

[Languages.zh-cn]
title = "Wails"
weight = 3
languageName = "简体中文"

Screenshot

image