mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
@@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"reflect"
|
||||
|
||||
"github.com/gohugoio/hugo/common/maps"
|
||||
@@ -517,6 +518,14 @@ func (ps Pages) String() string {
|
||||
return fmt.Sprintf("Pages(%d)", len(ps))
|
||||
}
|
||||
|
||||
// Used in tests.
|
||||
func (ps Pages) shuffle() {
|
||||
for i := range ps {
|
||||
j := rand.Intn(i + 1)
|
||||
ps[i], ps[j] = ps[j], ps[i]
|
||||
}
|
||||
}
|
||||
|
||||
func (ps Pages) findPagePosByFilename(filename string) int {
|
||||
for i, x := range ps {
|
||||
if x.Filename() == filename {
|
||||
|
Reference in New Issue
Block a user