|
@@ -6,14 +6,16 @@ import (
|
|
|
"path/filepath"
|
|
|
"strings"
|
|
|
|
|
|
- "git.clearsky.net.au/cody/gex.git/pkg/gex"
|
|
|
+ "git.clearsky.net.au/cody/gex.git/pkg/srv"
|
|
|
"git.clearsky.net.au/cody/gex.git/pkg/utils"
|
|
|
)
|
|
|
|
|
|
type Props map[string]any
|
|
|
type Funcs = template.FuncMap
|
|
|
|
|
|
-func Template(fp string, req *gex.Req, propFunc ...interface{}) string {
|
|
|
+var Include func(req *srv.Req, props Props, funcs Funcs)
|
|
|
+
|
|
|
+func Template(fp string, req *srv.Req, propFunc ...interface{}) string {
|
|
|
if !strings.Contains(fp, "app/") {
|
|
|
fp = utils.Cwd(2) + "/" + fp
|
|
|
}
|
|
@@ -30,7 +32,7 @@ func Template(fp string, req *gex.Req, propFunc ...interface{}) string {
|
|
|
funcs = propFunc[1].(Funcs)
|
|
|
}
|
|
|
|
|
|
- global(req, props, funcs)
|
|
|
+ Include(req, props, funcs)
|
|
|
|
|
|
tmpl, err := template.
|
|
|
New(filepath.Base(fp)).
|