Middleware pongo2 is a pongo2.v3 template engine support for Macaron.
go get github.com/go-macaron/pongo2
This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.
Package pongo2 is a middleware that provides pongo2 template engine support for Macaron.
License: Apache License 2.0
修改了gogsweb的源码,想将模板引擎换成 pongo2,在 i18n这里出错,提示 function "Tr" not defined。
引用是照着 http://macaron.gogs.io/docs/middlewares/templating.html 引用的:
m.Use(i18n.I18n(i18n.Options{
Langs: setting.Langs,
Names: setting.Names,
Redirect: true,
TmplName: "i18n",
}))
m.Use(pongo2.Pongoer())
tmpl文件里是照着 http://macaron.gogs.io/docs/middlewares/i18n.html 写的:
{{Tr(Lang,"hello %s","world")}}!
I got an issue in pongo2's issue tracker which is not related to pongo2 directly. It's more related to your add-on, so I'm creating this issue here on behalf of the user and referencing the issue in question.
The issue: flosch/pongo2#18
Unable to start the application when bindata is in use.
It looks like it's reading all files in the in the tree and trying to read them incorrectly somehow.
This same code/options works if I use macaron.Renderer
2016/03/27 23:29:39 "templates/test": [Error (where: fromfile) in templates/test.tmpl] open templates/test.tmpl: no such file or directory
像学习一下AngularJs,和pongo的变量定义{{}}有冲突,标准模板好像可以设置这个,pongo2可以吗
睡觉了,明天再来
fmt.Print打印的时候会默认调用String,
json序列号的时候会调用) MarshalJSON ,
请问pongo2显示变量的时候调用的什么函数?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.