1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 12:07:28 +00:00

Full support of the http.FileSystem on all view engines as requested at #1575

Also, the HandleDir accepts both string and http.FileSystem (interface{}) (like the view's fs)
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-05 08:34:09 +03:00
parent 7e6d453dad
commit e1f25eb098
50 changed files with 1613 additions and 1226 deletions

View File

@@ -1,7 +1,6 @@
package view
import (
"path"
"sync"
"github.com/yosssi/ace"
@@ -13,8 +12,13 @@ import (
// The given "extension" MUST begin with a dot.
//
// Read more about the Ace Go Parser: https://github.com/yosssi/ace
func Ace(directory, extension string) *HTMLEngine {
s := HTML(directory, extension)
//
// Usage:
// Ace("./views", ".ace") or
// Ace(iris.Dir("./views"), ".ace") or
// Ace(AssetFile(), ".ace") for embedded data.
func Ace(fs interface{}, extension string) *HTMLEngine {
s := HTML(fs, extension)
funcs := make(map[string]interface{}, 0)
@@ -30,7 +34,7 @@ func Ace(directory, extension string) *HTMLEngine {
}
})
name = path.Join(path.Clean(directory), name)
// name = path.Join(path.Clean(directory), name)
src := ace.NewSource(
ace.NewFile(name, text),