mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 05:25:58 +00:00
add support for fs.FS, embed.FS (in addition of string and http.FileSystem) for i18n locales and view engine's templates
This commit is contained in:
@@ -43,7 +43,7 @@ func WrapBlocks(v *blocks.Blocks) *BlocksEngine {
|
||||
// Usage:
|
||||
// Blocks("./views", ".html") or
|
||||
// Blocks(iris.Dir("./views"), ".html") or
|
||||
// Blocks(AssetFile(), ".html") for embedded data.
|
||||
// Blocks(embed.FS, ".html") or Blocks(AssetFile(), ".html") for embedded data.
|
||||
func Blocks(fs interface{}, extension string) *BlocksEngine {
|
||||
return WrapBlocks(blocks.New(fs).Extension(extension))
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func (s *BlocksEngine) Name() string {
|
||||
}
|
||||
|
||||
// RootDir sets the directory to use as the root one inside the provided File System.
|
||||
func (s *BlocksEngine) RootDir(root string) *BlocksEngine {
|
||||
func (s *BlocksEngine) RootDir(root string) *BlocksEngine { // TODO: update blocks for the new fs.FS interface and use it for Sub.
|
||||
s.Engine.RootDir(root)
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user