mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Source files can provide content as String or Bytes or Reader
This commit is contained in:
@@ -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())
|
||||
|
Reference in New Issue
Block a user