mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-17 15:45:12 -04:00
Source files can provide content as String or Bytes or Reader
This commit is contained in:
parent
dcea0fa5ce
commit
ad69374f8b
@ -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…
x
Reference in New Issue
Block a user