Skip to content

Commit

Permalink
feat(template): remove extra space during generation
Browse files Browse the repository at this point in the history
  • Loading branch information
rande committed Oct 3, 2023
1 parent 3987400 commit 1a37cad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 9 additions & 1 deletion core/embed/embed_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ func Configure(l *goapp.Lifecycle, conf *config.Config) {
l.Register(func(app *goapp.App) error {
app.Set("gonode.pongo", func(app *goapp.App) interface{} {

return pongo2.NewSet("gonode.embeds", &PongoTemplateLoader{
engine := pongo2.NewSet("gonode.embeds", &PongoTemplateLoader{
Embeds: app.Get("gonode.embeds").(*Embeds),
BasePath: "",
})

engine.Options = &pongo2.Options{
TrimBlocks: true,
LStripBlocks: true,
}

return engine

})

return nil
Expand Down
4 changes: 1 addition & 3 deletions core/embed/embed_pongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ func (l *PongoTemplateLoader) Abs(base, name string) string {
}

// Get returns an io.Reader where the template's content can be read from.
// blog:foo/blog.post.tpl => module=blog templates/foo/blog.post.tpl
func (l *PongoTemplateLoader) Get(path string) (io.Reader, error) {

// blog:foo/blog.post.tpl => module=blog templates/foo/blog.post.tpl

sections := strings.Split(path, ":")

if len(sections) != 2 {
Expand Down

0 comments on commit 1a37cad

Please sign in to comment.