summaryrefslogtreecommitdiffstats
path: root/hugolib/taxonomy.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-10-24 13:45:30 +0200
committerGitHub <noreply@github.com>2016-10-24 13:45:30 +0200
commita10b2cd372798c4e4b862f0ec03010d2aea2ff1e (patch)
treef768c420aac0008e4d118709e13fda278a7588c5 /hugolib/taxonomy.go
parentdffd7da07c3fb198acfa6c4664b53132c4cabe55 (diff)
Avoid reading from Viper for path and URL funcs
The gain, given the "real sites benchmark" below, is obvious: ``` benchmark old ns/op new ns/op delta BenchmarkHugo-4 14497594101 13084156335 -9.75% benchmark old allocs new allocs delta BenchmarkHugo-4 57404335 48282002 -15.89% benchmark old bytes new bytes delta BenchmarkHugo-4 9933505624 9721984424 -2.13% ``` Fixes #2495
Diffstat (limited to 'hugolib/taxonomy.go')
-rw-r--r--hugolib/taxonomy.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/hugolib/taxonomy.go b/hugolib/taxonomy.go
index ffe586ffc..112d22b37 100644
--- a/hugolib/taxonomy.go
+++ b/hugolib/taxonomy.go
@@ -52,7 +52,7 @@ type OrderedTaxonomyEntry struct {
// KeyPrep... Taxonomies should be case insensitive. Can make it easily conditional later.
func kp(in string) string {
- return helpers.MakePathSanitized(in)
+ return helpers.CurrentPathSpec().MakePathSanitized(in)
}
// Get the weighted pages for the given key.