1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-30 05:58:59 +01:00
gojekyll/pages/static_file.go

25 lines
419 B
Go
Raw Permalink Normal View History

package pages
import (
"io"
"os"
)
2017-07-25 17:08:53 +02:00
// A StaticFile is a static file. (Lint made me say this.)
type StaticFile struct {
file
}
2017-09-02 19:53:50 +02:00
// IsStatic is in the File interface.
func (p *StaticFile) IsStatic() bool { return true }
2017-07-10 19:23:51 +02:00
func (p *StaticFile) Write(w io.Writer) error {
in, err := os.Open(p.filename)
if err != nil {
return err
}
defer in.Close() // nolint: errcheck, gas
_, err = io.Copy(w, in)
return err
}