26 个回答
JohnSmith 2016-12-20 20:00:50
go 一般不做服务端渲染模板的
clino 2016-12-20 20:02:53
不会 go,不过搜了下感觉是不是内置了? https://golang.org/pkg/html/template/
Gem 2016-12-20 20:04:52
@JohnSmith 前后端分离更加合适? Go 提供 api ,前端用个 js 框架这样?
@clino 嗯,是内置了,貌似比较简陋。
@clino 嗯,是内置了,貌似比较简陋。
fishsjoy 2016-12-20 20:29:58
https://github.com/flosch/pongo2 没实际用过
est 2016-12-20 20:50:43
golang 还是老老实实做 rpc 做 api 好了。
janxin 2016-12-20 21:36:57
pongo2 还可以
neo1218 2016-12-20 21:40:39
噗, 可以自己写一个😂 给个 Python 的参考: http://python.jobbole.com/85155/
Tong16 2016-12-20 22:37:41
mustache
reus 2016-12-20 22:45:38
都是客户端渲染了,服务器端渲染已经是过时技术
scnace 2016-12-20 22:53:31
jinjia2 是啥不造 不过 go 模板引擎有内置的 template(
timothyye 2016-12-20 23:19:29
Go 适合提供 API 接口,不负责渲染,前端用 React, Vue 比较合适
haozibi 2016-12-20 23:35:29
iris 框架提供了一个类似 django 模板
jedihy 2016-12-20 23:50:21
@reus 问一下,只在客户端渲染,搜索引擎怎么抓取
rupert 2016-12-21 02:57:40
@jedihy goapi => nodejs 服务端渲染
xiamx 2016-12-21 06:21:17
@jedihy 可以用 http://GitHub.com/xiamx/ssr-proxy
Ahri 2016-12-21 07:59:53
Text templating is outdated.
guotie 2016-12-21 09:04:08
pongo2
cc7756789 2016-12-21 09:10:01
交给浏览器去做。
2goo 2016-12-21 09:10:14
go 内置 template 基本够用了 https://www.5-wow.com/article/detail/10 ,结合封装好的 render https://github.com/urfave/negroni
2goo 2016-12-21 09:10:54
render https://github.com/unrolled/render
mymike 2016-12-21 10:28:43
自己封装下 render 其实就可以了
penjianfeng 2016-12-21 13:46:21
同问,楼上说什么服务端渲染过时的我只想说,业务不同,不要轻易说过时
zonghua 2016-12-21 21:06:37
@penjianfeng SEO?
penjianfeng 2016-12-22 10:44:21
@zonghua 原因之一
zonghua 2016-12-22 20:53:34
@penjianfeng 我觉得时唯一原因
deweixu 2016-12-23 09:55:42
现在很多的项目差不多都是前后端分离了吧