hugo/helpers
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
..
baseURL.go Add some missing doc comments 2017-08-03 15:57:51 +02:00
baseURL_test.go all: Propagate baseURL error to the callers 2017-03-27 15:43:56 +02:00
content.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
content_renderer.go helpers: Avoid unescape in highlight 2018-01-23 09:48:04 +01:00
content_renderer_test.go Reuse the BlackFriday instance when possible 2017-12-16 19:44:33 +01:00
content_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
emoji.go helpers: Use iterate operator by int in Emojify 2016-11-23 09:13:00 +01:00
emoji_test.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
general.go hugolib: Extract date and slug from filename 2018-03-11 18:26:18 +01:00
general_test.go helpers: Avoid writing the last MD5 buff part twice 2017-12-28 22:52:27 +01:00
hugo.go releaser: Prepare repository for 0.38-DEV 2018-03-07 17:58:48 +00:00
hugo_test.go Properly handle -DEV suffix when comparing Hugo versions 2018-02-22 17:16:42 +01:00
language.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
language_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
path.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
path_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
pathspec.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
pathspec_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
processing_stats.go Run gofmt -s with Go 1.10 2018-02-21 09:59:33 +01:00
pygments.go Add table linenos support for Chroma highlighter 2017-10-14 16:00:27 +02:00
pygments_test.go Add table linenos support for Chroma highlighter 2017-10-14 16:00:27 +02:00
testhelpers_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00
url.go Fix URLs for bundle resources in multihost mode 2018-01-06 10:29:13 +01:00
url_test.go Add support for a content dir set per language 2018-04-02 08:06:21 +02:00