fix tags not being in lowercase, #491

This commit is contained in:
Joel Scoble
2014-09-09 15:58:02 -05:00
committed by spf13
parent 012a473e27
commit 4e9b04086a
3 changed files with 43 additions and 9 deletions

View File

@@ -431,7 +431,7 @@ func (page *Page) GetParam(key string) interface{} {
case bool:
return cast.ToBool(v)
case string:
return cast.ToString(v)
return strings.ToLower(cast.ToString(v))
case int64, int32, int16, int8, int:
return cast.ToInt(v)
case float64, float32:
@@ -439,7 +439,7 @@ func (page *Page) GetParam(key string) interface{} {
case time.Time:
return cast.ToTime(v)
case []string:
return v
return sliceToLower(v.([]string))
}
return nil
}
@@ -795,3 +795,17 @@ func (p *Page) TargetPath() (outfile string) {
return path.Join(p.Dir, strings.TrimSpace(outfile))
}
// sliceToLower goes through the source slice and lowers all values.
func sliceToLower(s []string) []string {
if s == nil {
return nil
}
l := make([]string, len(s))
for i, v := range s {
l[i] = strings.ToLower(v)
}
return l
}