package filter

import (
	"gitbase.de/apairon/mark2web/pkg/mark2web"
	"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(
		mark2web.ResolveNavPath(
			in.String(),
		),
	), nil
}
