mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Add template function slice
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
9349a889e2
commit
c1f8b188f7
@@ -105,6 +105,11 @@ func dictionary(values ...interface{}) (map[string]interface{}, error) {
|
||||
return dict, nil
|
||||
}
|
||||
|
||||
// slice returns a slice of all passed arguments
|
||||
func slice(args ...interface{}) []interface{} {
|
||||
return args
|
||||
}
|
||||
|
||||
func compareGetFloat(a interface{}, b interface{}) (float64, float64) {
|
||||
var left, right float64
|
||||
var leftStr, rightStr *string
|
||||
@@ -1558,6 +1563,7 @@ func init() {
|
||||
"seq": helpers.Seq,
|
||||
"shuffle": shuffle,
|
||||
"singularize": singularize,
|
||||
"slice": slice,
|
||||
"slicestr": slicestr,
|
||||
"sort": sortSeq,
|
||||
"split": split,
|
||||
|
Reference in New Issue
Block a user