Improve language handling in URLs

The current "rendering language" is needed outside of Site. This commit moves the Language type to the helpers package, and then used to get correct correct language configuration in the markdownify template func.
This commit also adds two new template funcs: relLangURL and absLangURL.

See #2309
This commit is contained in:
Bjørn Erik Pedersen
2016-08-07 22:01:55 +02:00
parent 2079a23dd8
commit 54141f71dd
20 changed files with 316 additions and 172 deletions

View File

@@ -43,7 +43,7 @@ func TestSitemapOutput(t *testing.T) {
s := &Site{
Source: &source.InMemorySource{ByteSource: weightedSources},
Language: newDefaultLanguage(),
Language: helpers.NewDefaultLanguage(),
}
if err := buildAndRenderSite(s, "sitemap.xml", SITEMAP_TEMPLATE); err != nil {