mark2web/pkg/filter/init.go
Sebastian Frank 0683e327c9
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
fixed pongo module version
2022-02-28 11:43:47 +01:00

30 lines
598 B
Go

package filter
import (
_ "github.com/flosch/pongo2-addons"
"github.com/flosch/pongo2/v4"
)
func init() {
err := pongo2.ReplaceFilter("markdown", MarkdownFilter)
// if err != nil {
// err = pongo2.RegisterFilter("markdown", MarkdownFilter)
if err != nil {
panic(err)
}
// }
newFilters := map[string]pongo2.FilterFunction{
"image_process": ImageProcessFilter,
"relative_path": RelativePathFilter,
"json": JSONFilter,
"dump": DumpFilter,
}
for name, fn := range newFilters {
err := pongo2.RegisterFilter(name, fn)
if err != nil {
panic(err)
}
}
}