Last active
April 15, 2017 08:37
-
-
Save LeeU1911/bc2a2464a15c817e9b0f0dd63ec8420c to your computer and use it in GitHub Desktop.
Minimal multilingual code example - Hugo issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Site settings | |
baseurl = "https://example.com" | |
defaultContentLanguage = "vi" | |
######################################## | |
# | |
## Vietnamese | |
[languages.vi] | |
title = "Xin chào" | |
weight = 0 | |
[[languages.vi.menu.main]] | |
url = "/blog" | |
name = "Blog" | |
weight = 0 | |
# Footer section | |
[languages.vi.params.footer] | |
enable = true | |
copyright = "Bản quyền (C) 2017" | |
[[languages.vi.params.footer.quicklinks]] | |
text = "Điều khoản sử dụng" | |
link = "/term-conditions" | |
[[languages.vi.params.footer.social]] | |
icon = "fa-facebook" | |
link = "https://www.facebook.com/" | |
######################################## | |
# | |
## English | |
[languages.en] | |
title = "Welcome" | |
weight = 0 | |
[[languages.en.menu.main]] | |
url = "/blogs" | |
name = "Blogs" | |
weight = 0 | |
# Footer section | |
[languages.en.params.footer] | |
enable = true | |
copyright = "Copyright (C) 2017" | |
[[languages.en.params.footer.quicklinks]] | |
text = "Term and Conditions" | |
link = "/term-conditions" | |
[[languages.en.params.footer.social]] | |
icon = "fa-facebook" | |
link = "https://www.facebook.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="{{ .Params.lang }}"> | |
<body id="page-top" class="index"> | |
<!-- Print out all Params values for debugging purpose --> | |
{{ printf "%#v" $.Site.Params }} | |
{{ if .Site.Params.footer.enable }} | |
{{ partial "footer.html" . }} | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See solution in my comment here: gohugoio/hugo#3346 (comment)