"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hugolib/content_map_page.go" between
hugo-0.85.0.tar.gz and hugo-0.86.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

content_map_page.go  (hugo-0.85.0):content_map_page.go  (hugo-0.86.0)
skipping to change at line 120 skipping to change at line 120
s.PathSpec.MakePathsSanitized(sections) s.PathSpec.MakePathsSanitized(sections)
} }
metaProvider := &pageMeta{kind: kind, sections: sections, bundled: bundle d, s: s, f: f} metaProvider := &pageMeta{kind: kind, sections: sections, bundled: bundle d, s: s, f: f}
ps, err := newPageBase(metaProvider) ps, err := newPageBase(metaProvider)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if n.fi.Meta().GetBool(walkIsRootFileMetaKey) { if n.fi.Meta().IsRootFile {
// Make sure that the bundle/section we start walking from is alw ays // Make sure that the bundle/section we start walking from is alw ays
// rendered. // rendered.
// This is only relevant in server fast render mode. // This is only relevant in server fast render mode.
ps.forceRender = true ps.forceRender = true
} }
n.p = ps n.p = ps
if ps.IsNode() { if ps.IsNode() {
ps.bucket = newPageBucket(ps) ps.bucket = newPageBucket(ps)
} }
skipping to change at line 252 skipping to change at line 252
seen[p] = true seen[p] = true
targetBasePaths = append(targetBasePaths, p) targetBasePaths = append(targetBasePaths, p)
} }
meta := fim.Meta() meta := fim.Meta()
r := func() (hugio.ReadSeekCloser, error) { r := func() (hugio.ReadSeekCloser, error) {
return meta.Open() return meta.Open()
} }
target := strings.TrimPrefix(meta.Path(), owner.File().Dir()) target := strings.TrimPrefix(meta.Path, owner.File().Dir())
return owner.s.ResourceSpec.New( return owner.s.ResourceSpec.New(
resources.ResourceSourceDescriptor{ resources.ResourceSourceDescriptor{
TargetPaths: owner.getTargetPaths, TargetPaths: owner.getTargetPaths,
OpenReadSeekCloser: r, OpenReadSeekCloser: r,
FileInfo: fim, FileInfo: fim,
RelTargetFilename: target, RelTargetFilename: target,
TargetBasePaths: targetBasePaths, TargetBasePaths: targetBasePaths,
LazyPublish: !owner.m.buildConfig.PublishResources , LazyPublish: !owner.m.buildConfig.PublishResources ,
}) })
skipping to change at line 397 skipping to change at line 397
return err return err
} }
func (m *pageMap) assembleResources(s string, p *pageState, parentBucket *pagesM apBucket) error { func (m *pageMap) assembleResources(s string, p *pageState, parentBucket *pagesM apBucket) error {
var err error var err error
m.resources.WalkPrefix(s, func(s string, v interface{}) bool { m.resources.WalkPrefix(s, func(s string, v interface{}) bool {
n := v.(*contentNode) n := v.(*contentNode)
meta := n.fi.Meta() meta := n.fi.Meta()
classifier := meta.Classifier() classifier := meta.Classifier
var r resource.Resource var r resource.Resource
switch classifier { switch classifier {
case files.ContentClassContent: case files.ContentClassContent:
var rp *pageState var rp *pageState
rp, err = m.newPageFromContentNode(n, parentBucket, p) rp, err = m.newPageFromContentNode(n, parentBucket, p)
if err != nil { if err != nil {
return true return true
} }
rp.m.resourcePath = filepath.ToSlash(strings.TrimPrefix(r p.Path(), p.File().Dir())) rp.m.resourcePath = filepath.ToSlash(strings.TrimPrefix(r p.Path(), p.File().Dir()))
r = rp r = rp
skipping to change at line 465 skipping to change at line 465
if s != "/" { if s != "/" {
_, parent = m.getSection(s) _, parent = m.getSection(s)
if parent == nil || parent.p == nil { if parent == nil || parent.p == nil {
panic(fmt.Sprintf("BUG: parent not set for %q", s )) panic(fmt.Sprintf("BUG: parent not set for %q", s ))
} }
} }
if parent != nil { if parent != nil {
parentBucket = parent.p.bucket parentBucket = parent.p.bucket
} else if s == "/" {
parentBucket = m.s.siteBucket
} }
kind := page.KindSection kind := page.KindSection
if s == "/" { if s == "/" {
kind = page.KindHome kind = page.KindHome
} }
if n.fi != nil { if n.fi != nil {
n.p, err = m.newPageFromContentNode(n, parentBucket, nil) n.p, err = m.newPageFromContentNode(n, parentBucket, nil)
if err != nil { if err != nil {
return true return true
} }
} else { } else {
n.p = m.s.newPage(n, parentBucket, kind, "", sections...) n.p = m.s.newPage(n, parentBucket, kind, "", sections...)
 End of changes. 5 change blocks. 
3 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)