mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 09:23:09 +00:00
Fix path functions
This commit is contained in:
parent
69f39d7303
commit
08443f1493
18
config.go
18
config.go
|
@ -94,14 +94,14 @@ var funcs = map[string]interface{}{
|
||||||
"safeCSS": func(s string) htemplate.CSS { return htemplate.CSS(s) },
|
"safeCSS": func(s string) htemplate.CSS { return htemplate.CSS(s) },
|
||||||
"safeJS": func(s string) htemplate.JS { return htemplate.JS(s) },
|
"safeJS": func(s string) htemplate.JS { return htemplate.JS(s) },
|
||||||
"safeURL": func(s string) htemplate.URL { return htemplate.URL(s) },
|
"safeURL": func(s string) htemplate.URL { return htemplate.URL(s) },
|
||||||
"path": func() map[string]interface{} { return pathFuncs },
|
"path": func() pathFuncs { return pathFuncs{} },
|
||||||
}
|
}
|
||||||
|
|
||||||
var pathFuncs = map[string]interface{}{
|
type pathFuncs struct{}
|
||||||
"Base": path.Base,
|
|
||||||
"Clean": path.Clean,
|
func (pathFuncs) Base(s string) string { return path.Base(s) }
|
||||||
"Dir": path.Dir,
|
func (pathFuncs) Clean(s string) string { return path.Clean(s) }
|
||||||
"Ext": path.Ext,
|
func (pathFuncs) Dir(s string) string { return path.Dir(s) }
|
||||||
"Join": path.Join,
|
func (pathFuncs) Ext(s string) string { return path.Ext(s) }
|
||||||
"Split": path.Split,
|
func (pathFuncs) Join(elem ...string) string { return path.Join(elem...) }
|
||||||
}
|
func (pathFuncs) Split(s string) (string, string) { return path.Split(s) }
|
||||||
|
|
Loading…
Reference in a new issue