hugolib: Must update PathSpec on SiteInfo per language
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 7 Nov 2016 20:16:55 +0000 (21:16 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 7 Nov 2016 20:17:51 +0000 (21:17 +0100)
hugolib/hugo_sites_test.go
hugolib/site.go

index 5a44fb5f9cd5a4df8882d98c9900ed73038072a7..bb92a42cf3f2f9ca260575f176817e258373246f 100644 (file)
@@ -78,6 +78,8 @@ func doTestMultiSitesMainLangInRoot(t *testing.T, defaultInSubDir bool) {
                require.Equal(t, "", frSite.Info.LanguagePrefix)
        }
 
+       require.Equal(t, "/blog/en/foo", enSite.Info.pathSpec.RelURL("foo", true))
+
        doc1en := enSite.Pages[0]
        doc1fr := frSite.Pages[0]
 
index 1a6c50fce25c68a87c9d9693bfeeb513202dbe46..b7f4c28c871ee0457527f292854627c1a62c41cb 100644 (file)
@@ -823,6 +823,7 @@ func (s *Site) setCurrentLanguageConfig() error {
        viper.Set("currentContentLanguage", s.Language)
        // Cache the current config.
        helpers.InitConfigProviderForCurrentContentLanguage()
+       s.Info.pathSpec = helpers.CurrentPathSpec()
        return tpl.SetTranslateLang(s.Language)
 }