mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-28 21:54:47 +00:00
eb42774e58
A sample config: ```toml defaultContentLanguage = "en" defaultContentLanguageInSubdir = true [Languages] [Languages.en] weight = 10 title = "In English" languageName = "English" contentDir = "content/english" [Languages.nn] weight = 20 title = "På Norsk" languageName = "Norsk" contentDir = "content/norwegian" ``` The value of `contentDir` can be any valid path, even absolute path references. The only restriction is that the content dirs cannot overlap. The content files will be assigned a language by 1. The placement: `content/norwegian/post/my-post.md` will be read as Norwegian content. 2. The filename: `content/english/post/my-post.nn.md` will be read as Norwegian even if it lives in the English content folder. The content directories will be merged into a big virtual filesystem with one simple rule: The most specific language file will win. This means that if both `content/norwegian/post/my-post.md` and `content/english/post/my-post.nn.md` exists, they will be considered duplicates and the version inside `content/norwegian` will win. Note that translations will be automatically assigned by Hugo by the content file's relative placement, so `content/norwegian/post/my-post.md` will be a translation of `content/english/post/my-post.md`. If this does not work for you, you can connect the translations together by setting a `translationKey` in the content files' front matter. Fixes #4523 Fixes #4552 Fixes #4553 |
||
---|---|---|
.. | ||
pagemeta | ||
testdata | ||
testsite/content | ||
404_test.go | ||
alias.go | ||
alias_test.go | ||
author.go | ||
case_insensitive_test.go | ||
config.go | ||
config_test.go | ||
datafiles_test.go | ||
disableKinds_test.go | ||
embedded_shortcodes_test.go | ||
fileInfo.go | ||
gitinfo.go | ||
hugo_info.go | ||
hugo_info_test.go | ||
hugo_sites.go | ||
hugo_sites_build.go | ||
hugo_sites_build_failures_test.go | ||
hugo_sites_build_test.go | ||
hugo_sites_multihost_test.go | ||
language_content_dir_test.go | ||
media.go | ||
menu.go | ||
menu_test.go | ||
multilingual.go | ||
page.go | ||
page_bundler.go | ||
page_bundler_capture.go | ||
page_bundler_capture_test.go | ||
page_bundler_handlers.go | ||
page_bundler_test.go | ||
page_collections.go | ||
page_collections_test.go | ||
page_output.go | ||
page_paths.go | ||
page_paths_test.go | ||
page_permalink_test.go | ||
page_resource.go | ||
page_taxonomy_test.go | ||
page_test.go | ||
page_time_integration_test.go | ||
pageCache.go | ||
pageCache_test.go | ||
pageGroup.go | ||
pageGroup_test.go | ||
pages_language_merge.go | ||
pages_language_merge_test.go | ||
pages_related.go | ||
pages_related_test.go | ||
pageSort.go | ||
pageSort_test.go | ||
pagesPrevNext.go | ||
pagesPrevNext_test.go | ||
pagination.go | ||
pagination_test.go | ||
path_separators_test.go | ||
permalinker.go | ||
permalinks.go | ||
permalinks_test.go | ||
prune_resources.go | ||
robotstxt_test.go | ||
rss_test.go | ||
scratch.go | ||
scratch_test.go | ||
shortcode.go | ||
shortcode_test.go | ||
shortcodeparser.go | ||
shortcodeparser_test.go | ||
site.go | ||
site_benchmark_test.go | ||
site_output.go | ||
site_output_test.go | ||
site_render.go | ||
site_sections.go | ||
site_sections_test.go | ||
site_stats_test.go | ||
site_test.go | ||
site_url_test.go | ||
siteJSONEncode_test.go | ||
sitemap.go | ||
sitemap_test.go | ||
taxonomy.go | ||
taxonomy_test.go | ||
template_engines_test.go | ||
template_test.go | ||
testhelpers_test.go | ||
translations.go |