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

@@ -1202,13 +1202,13 @@ func (p *Page) TargetPath() (outfile string) {
// TODO(bep) np
switch p.NodeType {
case NodeHome:
return p.addLangFilepathPrefix("index.html")
return p.addLangFilepathPrefix("/")
case NodeSection:
return p.addLangFilepathPrefix(filepath.Join(p.sections[0], "index.html"))
return p.addLangFilepathPrefix(p.sections[0])
case NodeTaxonomy:
return p.addLangFilepathPrefix(filepath.Join(append(p.sections, "index.html")...))
return p.addLangFilepathPrefix(filepath.Join(p.sections...))
case NodeTaxonomyTerms:
return p.addLangFilepathPrefix(filepath.Join(append(p.sections, "index.html")...))
return p.addLangFilepathPrefix(filepath.Join(p.sections...))
}
// Always use URL if it's specified