예제 #1
0
func (b basicPageHandler) Read(f *source.File, s *Site) HandledResult {
	page, err := NewPage(f.Path())
	if err != nil {
		return HandledResult{file: f, err: err}
	}

	if _, err := page.ReadFrom(f.Contents); err != nil {
		return HandledResult{file: f, err: err}
	}

	page.Site = &s.Info
	page.Tmpl = s.Tmpl

	return HandledResult{file: f, page: page, err: err}
}
예제 #2
0
func (h cssHandler) FileConvert(f *source.File, s *Site) HandledResult {
	x := cssmin.Minify(f.Bytes())
	s.WriteDestFile(f.Path(), helpers.BytesToReader(x))
	return HandledResult{file: f}
}
예제 #3
0
func (h defaultHandler) FileConvert(f *source.File, s *Site) HandledResult {
	s.WriteDestFile(f.Path(), f.Contents)
	return HandledResult{file: f}
}