mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 02:16:09 +00:00
Allow to reverse taxonomy entries.
This commit is contained in:
1 parent
be3a3506c4
commit
d5c77bdf68
1 file changed
+8
@@ -116,6 +116,14 @@ func (ie OrderedTaxonomyEntry) Term() string {
|
|||||||
return ie.Name
|
return ie.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t OrderedTaxonomy) Reverse() OrderedTaxonomy {
|
||||||
|
for i, j := 0, len(t)-1; i < j; i, j = i+1, j-1 {
|
||||||
|
t[i], t[j] = t[j], t[i]
|
||||||
|
}
|
||||||
|
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implementation of a custom sorter for OrderedTaxonomies
|
* Implementation of a custom sorter for OrderedTaxonomies
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in new issue
Block a user