From: spf13 Date: Tue, 4 Nov 2014 05:28:20 +0000 (-0500) Subject: Source files can provide content as String or Bytes or Reader X-Git-Tag: v0.13~348 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ad69374f8b132f0afddb9203300c600b9f21386b;p=brevno-suite%2Fhugo Source files can provide content as String or Bytes or Reader --- diff --git a/source/file.go b/source/file.go index ce1469d5..909d457d 100644 --- a/source/file.go +++ b/source/file.go @@ -39,6 +39,14 @@ func (f *File) UniqueId() string { return f.uniqueId } +func (f *File) String() string { + return helpers.ReaderToString(f.Contents) +} + +func (f *File) Bytes() []byte { + return helpers.ReaderToBytes(f.Contents) +} + // Filename without extension func (f *File) BaseFileName() string { return helpers.Filename(f.LogicalName())