mark2web/filter/relative_path.go

16 lines
332 B
Go
Raw Normal View History

2019-03-18 13:34:52 +01:00
package filter
import (
2019-03-18 15:14:41 +01:00
"gitbase.de/apairon/mark2web"
2019-03-18 13:34:52 +01:00
"github.com/flosch/pongo2"
)
// RelativePathFilter returns the relative path to navpoint based on current nav
func RelativePathFilter(in, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) {
return pongo2.AsValue(
2019-03-18 15:14:41 +01:00
mark2web.ResolveNavPath(
2019-03-18 13:34:52 +01:00
in.String(),
),
), nil
}