mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02: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:
@@ -265,9 +265,9 @@ func (s *Site) initializeSiteInfo() {
|
||||
params = make(map[string]interface{})
|
||||
}
|
||||
|
||||
permalinks, ok := viper.Get("Permalinks").(PermalinkOverrides)
|
||||
if !ok {
|
||||
permalinks = make(PermalinkOverrides)
|
||||
permalinks := make(PermalinkOverrides)
|
||||
for k, v := range viper.GetStringMapString("Permalinks") {
|
||||
permalinks[k] = PathPattern(v)
|
||||
}
|
||||
|
||||
s.Info = SiteInfo{
|
||||
|
Reference in New Issue
Block a user