hugo/commands
Bjørn Erik Pedersen eb42774e58
Add support for a content dir set per language
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
2018-04-02 08:06:21 +02:00
..
benchmark.go Fix hugo benchmark --renderToMemory 2018-01-06 10:37:04 +01:00
check.go Remove ShowPlan 2016-11-23 16:35:49 +01:00
commandeer.go Allow themes to define output formats, media types and params 2018-03-21 09:22:19 +01:00
convert.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
env.go all: Use jww instead of fmt for printing 2016-11-22 22:06:48 +01:00
gen.go Add copyright header to that source files that don’t have one. 2015-12-10 15:19:38 -07:00
genautocomplete.go commands: Make first letter of flags' usage lowercase 2017-04-26 22:23:20 +02:00
genchromastyles.go Use Chroma as new default syntax highlighter 2017-09-25 08:59:02 +02:00
gendoc.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
gendocshelper.go Revert "commands: Adjust docs path" 2017-07-06 10:34:04 +02:00
genman.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
hugo.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
hugo_windows.go Move cobra.MousetrapHelpText to hugo_windows.go 2015-12-16 21:26:47 -07:00
import_jekyll.go Only set 'url' if permalink in metadata and remove duplicate confirm msg 2018-01-28 11:24:31 +01:00
import_jekyll_test.go Only set 'url' if permalink in metadata and remove duplicate confirm msg 2018-01-28 11:24:31 +01:00
limit_darwin.go commands: Adjust rlimit to 64000 2017-06-12 20:43:19 +02:00
limit_others.go Revert "commands: Remove the rlimit tweaking on macOS" 2017-06-12 20:35:19 +02:00
list.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
list_config.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
new.go releaser: Prepare repository for 0.38-DEV 2018-03-07 17:58:48 +00:00
new_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
release.go Set up Hugo release flow on CircleCI 2017-09-10 17:14:02 +02:00
server.go Allow themes to define output formats, media types and params 2018-03-21 09:22:19 +01:00
server_test.go Add multilingual multihost support 2017-11-17 11:01:46 +01:00
static_syncer.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
version.go commands: Remove superflous BuildDate logic 2018-01-14 20:08:28 +01:00