node to page: Handle aliases, 404, robots.txt, sitemap

Updates #2297
This commit is contained in:
Bjørn Erik Pedersen
2016-11-08 23:34:52 +01:00
parent ec2d502b4f
commit bde1bfd34a
9 changed files with 181 additions and 192 deletions

View File

@@ -37,11 +37,7 @@ import (
// Temporary feature flag to ease the refactoring of node vs page, see
// https://github.com/spf13/hugo/issues/2297
// TODO(bep) eventually remove
var nodePageFeatureFlag bool
func toggleNodePageFeatureFlag() {
nodePageFeatureFlag = !nodePageFeatureFlag
}
var nodePageFeatureFlag bool = true
// HugoSites represents the sites to build. Each site represents a language.
type HugoSites struct {
@@ -516,13 +512,15 @@ func (h *HugoSites) createMissingNodes() error {
// Move the new* methods after cleanup in site.go
func (s *Site) newNodePage(typ NodeType) *Page {
return &Page{Node: Node{
NodeType: typ,
Data: make(map[string]interface{}),
Site: &s.Info,
language: s.Language,
}, site: s}
return &Page{
Node: Node{
Date: s.Info.LastChange,
Lastmod: s.Info.LastChange,
NodeType: typ,
Data: make(map[string]interface{}),
Site: &s.Info,
language: s.Language,
}, site: s}
}
func (s *Site) newHomePage() *Page {