fixed pongo module version
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"gitbase.de/apairon/mark2web/pkg/logger"
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
"github.com/ddliu/motto"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
_ "github.com/robertkrimen/otto/underscore"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package filter
|
||||
|
||||
import (
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
// DumpFilter is a pongo2 filter, which returns a spew.Dump of the input
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
"gitbase.de/apairon/mark2web/pkg/webrequest"
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
func parseImageParams(str string) (*mark2web.ImagingConfig, error) {
|
||||
@@ -211,9 +211,9 @@ func ImageProcessFilter(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *
|
||||
}
|
||||
} else {
|
||||
out, err := os.Create(imgTarget)
|
||||
logger.Eexit(err, "filter:image_resize, could not create image file '%s'", imgTarget)
|
||||
defer out.Close()
|
||||
|
||||
logger.Eexit(err, "filter:image_resize, could not create image file '%s'", imgTarget)
|
||||
switch p.Format {
|
||||
case "jpeg", "jpg":
|
||||
var jpegOpt *jpeg.Options
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"gitbase.de/apairon/mark2web/pkg/jobm"
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package filter
|
||||
|
||||
import (
|
||||
"github.com/flosch/pongo2"
|
||||
_ "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 {
|
||||
err = pongo2.RegisterFilter("markdown", MarkdownFilter)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
// }
|
||||
|
||||
newFilters := map[string]pongo2.FilterFunction{
|
||||
"image_process": ImageProcessFilter,
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
// JSONFilter is a pongo2 filter, which returns a json string of the input
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"math"
|
||||
"testing"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
// MarkdownFilter is a pongo2 filter, which converts markdown to html
|
||||
|
||||
@@ -3,7 +3,7 @@ package filter
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@ package filter
|
||||
|
||||
import (
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
// RelativePathFilter returns the relative path to navpoint based on current nav
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"gitbase.de/apairon/mark2web/pkg/logger"
|
||||
"gitbase.de/apairon/mark2web/pkg/webrequest"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
type colCacheEntry struct {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/logger"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
cpy "github.com/otiai10/copy"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
@@ -72,7 +72,7 @@ func (node *TreeNode) processMarkdownWithHeader(md []byte, errorRef string) (*Pa
|
||||
|
||||
newConfig := new(PathConfig)
|
||||
|
||||
headerRegex := regexp.MustCompile(`(?s)^---(.*?)\r?\n\r?---\r?\\n\r?`)
|
||||
headerRegex := regexp.MustCompile("(?s)^---(.*?)\\r?\\n\\r?---\\r?\\n\\r?")
|
||||
yamlData := headerRegex.Find(md)
|
||||
if string(yamlData) != "" {
|
||||
// replace tabs
|
||||
@@ -95,7 +95,7 @@ func (node *TreeNode) processMarkdownWithHeader(md []byte, errorRef string) (*Pa
|
||||
}
|
||||
|
||||
// use --- for splitting document in markdown parts
|
||||
regex := regexp.MustCompile(`\r?\n\r?---\r?\n\r?`)
|
||||
regex := regexp.MustCompile("\\r?\\n\\r?---\\r?\\n\\r?")
|
||||
inputParts := regex.Split(string(md), -1)
|
||||
htmlParts := make([]*pongo2.Value, 0)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"gitbase.de/apairon/mark2web/pkg/progress"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/extemporalgenome/slug"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package mark2web
|
||||
|
||||
import (
|
||||
"gitbase.de/apairon/mark2web/pkg/webrequest"
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
// RequestFn will make a web request and returns map[string]interface form pongo2
|
||||
|
||||
@@ -3,7 +3,7 @@ package mark2web
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/flosch/pongo2/v4"
|
||||
)
|
||||
|
||||
var templateCache = make(map[string]*pongo2.Template)
|
||||
|
||||
Reference in New Issue
Block a user