diff options
author | Bjørn Erik Pedersen <[email protected]> | 2016-08-07 22:01:55 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2016-09-06 18:32:18 +0300 |
commit | 54141f71dd0ffbd2af326581b78ecafe7f054f51 (patch) | |
tree | a814b50027d9c9a439aa43eeb734f97e189ed968 /hugolib/site_url_test.go | |
parent | 2079a23dd89734cea39e523faf46e44201151279 (diff) | |
download | hugo-54141f71dd0ffbd2af326581b78ecafe7f054f51.tar.gz hugo-54141f71dd0ffbd2af326581b78ecafe7f054f51.zip |
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
Diffstat (limited to 'hugolib/site_url_test.go')
-rw-r--r-- | hugolib/site_url_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hugolib/site_url_test.go b/hugolib/site_url_test.go index 6b96b09dc..522732cc2 100644 --- a/hugolib/site_url_test.go +++ b/hugolib/site_url_test.go @@ -17,6 +17,8 @@ import ( "path/filepath" "testing" + "github.com/spf13/hugo/helpers" + "html/template" "github.com/spf13/hugo/hugofs" @@ -90,7 +92,7 @@ func TestPageCount(t *testing.T) { viper.Set("paginate", 10) s := &Site{ Source: &source.InMemorySource{ByteSource: urlFakeSource}, - Language: newDefaultLanguage(), + Language: helpers.NewDefaultLanguage(), } if err := buildAndRenderSite(s, "indexes/blue.html", indexTemplate); err != nil { |