summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_build.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-03 10:47:43 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-04 23:33:35 +0100
commite52e2a70e5e0a2d15fc9befbcd7290761c98589e (patch)
treece133a021fcd7535ec2c89ea7897ff543b710a4a /hugolib/hugo_sites_build.go
parentea165bf9e71c7ca9ddb9f14ddbdbcd506ce554bb (diff)
hugolib, target: Rework/move the target package
This relates to #3123. The interfaces and types in `target` made sense at some point, but now this package is too restricted to a hardcoded set of media types. The overall current logic: * Create a file path based on some `Translator` with some hardcoded logic handling uglyURLs, hardcoded html suffix etc. * In in some cases (alias), a template is applied to create the alias file. * Then the content is written to destination. One could argue that it is the last bullet that is the actual core responsibility. This commit fixes that by moving the `hugolib`-related logic where it belong, and simplify the code, i.e. remove the abstractions. This code will most certainly evolve once we start on #3123, but now it is at least possible to understand where to start. Fixes #3123
Diffstat (limited to 'hugolib/hugo_sites_build.go')
-rw-r--r--hugolib/hugo_sites_build.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go
index 2e54cb7a8..471c1a65d 100644
--- a/hugolib/hugo_sites_build.go
+++ b/hugolib/hugo_sites_build.go
@@ -194,6 +194,8 @@ func (h *HugoSites) assemble(config *BuildCfg) error {
func (h *HugoSites) render(config *BuildCfg) error {
if !config.SkipRender {
for _, s := range h.Sites {
+ s.initSiteWriter()
+
if err := s.render(); err != nil {
return err
}