mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Source files can provide content as String or Bytes or Reader
This commit is contained in:
parent
dcea0fa5ce
commit
ad69374f8b
1 changed files with 8 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue