1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-27 13:34:49 +01:00
gojekyll/pages/staticpage.go
2017-06-22 11:12:59 -04:00

24 lines
404 B
Go

package pages
import (
"io"
"io/ioutil"
)
// StaticPage is a static page.
type StaticPage struct {
pageFields
}
// Static returns a bool indicating that the page is a static page.
func (p *StaticPage) Static() bool { return true }
func (p *StaticPage) Write(_ Context, w io.Writer) error {
b, err := ioutil.ReadFile(p.filename)
if err != nil {
return err
}
_, err = w.Write(b)
return err
}