summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_build.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-09 19:19:29 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-27 15:43:56 +0200
commit6bf010fed432e5574e19fd2946ee6397d895950e (patch)
tree75282ccbd526adc8dba62f9392db282b3bcec49f /hugolib/hugo_sites_build.go
parentc8fff9501d424882a42f750800d9982ec47df640 (diff)
hugolib: Refactor/-work the permalink/target path logic
This is a pretty fundamental change in Hugo, but absolutely needed if we should have any hope of getting "multiple outputs" done. This commit's goal is to say: * Every file target path is created by `createTargetPath`, i.e. one function for all. * That function takes every page and site parameter into account, to avoid fragile string parsing to uglify etc. later on. * The path creation logic has full test coverage. * All permalinks, paginator URLs etc. are then built on top of that same logic. Fixes #1252 Fixes #2110 Closes #2374 Fixes #1885 Fixes #3102 Fixes #3179 Fixes #1641 Fixes #1989
Diffstat (limited to 'hugolib/hugo_sites_build.go')
-rw-r--r--hugolib/hugo_sites_build.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go
index 471c1a65d..ce7271cd3 100644
--- a/hugolib/hugo_sites_build.go
+++ b/hugolib/hugo_sites_build.go
@@ -174,6 +174,12 @@ func (h *HugoSites) assemble(config *BuildCfg) error {
}
for _, s := range h.Sites {
+ for _, p := range s.Pages {
+ // May have been set in front matter
+ if len(p.outputTypes) == 0 {
+ p.outputTypes = s.defaultOutputDefinitions.ForKind(p.Kind)
+ }
+ }
s.assembleMenus()
s.refreshPageCaches()
s.setupSitePages()