"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hugolib/pages_process.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).

pages_process.go  (hugo-0.85.0):pages_process.go  (hugo-0.86.0)
skipping to change at line 92 skipping to change at line 92
var err error var err error
for _, p := range proc.procs { for _, p := range proc.procs {
if e := p.Wait(); e != nil { if e := p.Wait(); e != nil {
err = e err = e
} }
} }
return err return err
} }
func (proc *pagesProcessor) getProcFromFi(fi hugofs.FileMetaInfo) pagesCollector ProcessorProvider { func (proc *pagesProcessor) getProcFromFi(fi hugofs.FileMetaInfo) pagesCollector ProcessorProvider {
if p, found := proc.procs[fi.Meta().Lang()]; found { if p, found := proc.procs[fi.Meta().Lang]; found {
return p return p
} }
return defaultPageProcessor return defaultPageProcessor
} }
type nopPageProcessor int type nopPageProcessor int
func (nopPageProcessor) Process(item interface{}) error { func (nopPageProcessor) Process(item interface{}) error {
return nil return nil
} }
skipping to change at line 154 skipping to change at line 154
func (p *sitePagesProcessor) copyFile(fim hugofs.FileMetaInfo) error { func (p *sitePagesProcessor) copyFile(fim hugofs.FileMetaInfo) error {
meta := fim.Meta() meta := fim.Meta()
f, err := meta.Open() f, err := meta.Open()
if err != nil { if err != nil {
return errors.Wrap(err, "copyFile: failed to open") return errors.Wrap(err, "copyFile: failed to open")
} }
s := p.m.s s := p.m.s
target := filepath.Join(s.PathSpec.GetTargetLanguageBasePath(), meta.Path ()) target := filepath.Join(s.PathSpec.GetTargetLanguageBasePath(), meta.Path )
defer f.Close() defer f.Close()
return s.publish(&s.PathSpec.ProcessingStats.Files, target, f) return s.publish(&s.PathSpec.ProcessingStats.Files, target, f)
} }
func (p *sitePagesProcessor) doProcess(item interface{}) error { func (p *sitePagesProcessor) doProcess(item interface{}) error {
m := p.m m := p.m
switch v := item.(type) { switch v := item.(type) {
case *fileinfoBundle: case *fileinfoBundle:
if err := m.AddFilesBundle(v.header, v.resources...); err != nil { if err := m.AddFilesBundle(v.header, v.resources...); err != nil {
return err return err
} }
case hugofs.FileMetaInfo: case hugofs.FileMetaInfo:
if p.shouldSkip(v) { if p.shouldSkip(v) {
return nil return nil
} }
meta := v.Meta() meta := v.Meta()
classifier := meta.Classifier() classifier := meta.Classifier
switch classifier { switch classifier {
case files.ContentClassContent: case files.ContentClassContent:
if err := m.AddFilesBundle(v); err != nil { if err := m.AddFilesBundle(v); err != nil {
return err return err
} }
case files.ContentClassFile: case files.ContentClassFile:
if err := p.copyFile(v); err != nil { if err := p.copyFile(v); err != nil {
return err return err
} }
default: default:
panic(fmt.Sprintf("invalid classifier: %q", classifier)) panic(fmt.Sprintf("invalid classifier: %q", classifier))
} }
default: default:
panic(fmt.Sprintf("unrecognized item type in Process: %T", item)) panic(fmt.Sprintf("unrecognized item type in Process: %T", item))
} }
return nil return nil
} }
func (p *sitePagesProcessor) shouldSkip(fim hugofs.FileMetaInfo) bool { func (p *sitePagesProcessor) shouldSkip(fim hugofs.FileMetaInfo) bool {
// TODO(ep) unify // TODO(ep) unify
return p.m.s.SourceSpec.DisabledLanguages[fim.Meta().Lang()] return p.m.s.SourceSpec.DisabledLanguages[fim.Meta().Lang]
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

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