projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0bb3b49
)
Small refactor: don't call `p.Permalink()` for all aliases, call it only
author
Alexandre Bourget
<alex@bourget.cc>
Wed, 30 Dec 2015 05:47:59 +0000
(
00:47
-0500)
committer
Steve Francia
<steve.francia@gmail.com>
Mon, 4 Jan 2016 17:41:06 +0000
(12:41 -0500)
once and only if necessary.
hugolib/site.go
patch
|
blob
|
history
diff --git
a/hugolib/site.go
b/hugolib/site.go
index f93d6ff6b32c227c57a63f3d4b97ff0a54d1d099..4904c31b78ad654aedd6f0fa006e49785401fae7 100644
(file)
--- a/
hugolib/site.go
+++ b/
hugolib/site.go
@@
-1060,11
+1060,16
@@
func (s *Site) possibleTaxonomies() (taxonomies []string) {
// RenderAliases renders shell pages that simply have a redirect in the header
func (s *Site) RenderAliases() error {
for _, p := range s.Pages {
+ if len(p.Aliases) == 0 {
+ continue
+ }
+
+ plink, err := p.Permalink()
+ if err != nil {
+ return err
+ }
+
for _, a := range p.Aliases {
- plink, err := p.Permalink()
- if err != nil {
- return err
- }
if err := s.WriteDestAlias(a, plink); err != nil {
return err
}