mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +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
|
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
|
// Filename without extension
|
||||||
func (f *File) BaseFileName() string {
|
func (f *File) BaseFileName() string {
|
||||||
return helpers.Filename(f.LogicalName())
|
return helpers.Filename(f.LogicalName())
|
||||||
|
Reference in New Issue
Block a user