mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Fix permalink functionality, which was broken in 62dd1d4
.
Viper stores Permalinks as a map[string]interface{}, so the type assertion to PermalinkOverrides (map[string]PathPattern) will always fail. We can, however, get Permalinks as a map[string]string, and convert each value to a PathPattern.
This commit is contained in:
@@ -30,3 +30,15 @@ func TestSiteInfoParams(t *testing.T) {
|
||||
t.Errorf("Expected FOOBAR_PARAM: got %s", buf.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestSiteInfoPermalinks (t *testing.T) {
|
||||
viper.Set("Permalinks", map[string]interface{}{"section": "/:title"})
|
||||
s := &Site{}
|
||||
|
||||
s.initialize()
|
||||
permalink := s.Info.Permalinks["section"]
|
||||
|
||||
if permalink != "/:title" {
|
||||
t.Errorf("Could not set permalink (%#v)", permalink)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user