wendal / gor

Golang编写的静态博客引擎
599 stars 147 forks source link

JS是脚本语言,GO是编译语言,可不可以不要把 html 和 js 写到 go 源代码里面? #84

Open DrayChou opened 9 years ago

DrayChou commented 9 years ago

这样扩展性差了好多啊。而且我为什么非得用 sinapp 的 jquery ,我不可以用别的地址的 jquery 吗?

wendal commented 9 years ago

? 哪里用到sinapp 的jquery了? 没看到呢

DrayChou commented 9 years ago

看26行:https://github.com/wendal/gor/blob/master/gor/gor.go

wendal commented 9 years ago

那是边修改边预览的代码啊... 又不是最终生成的页面

DrayChou commented 9 years ago

呃,好吧。总感觉在 go 源代码里添加 html,js 代码怪怪的。 我之前开了一个 branch 出来就是把这些单独拿出去的。 看你之前那些修改这些好像都拿出去了吧。

DrayChou commented 9 years ago

https://github.com/wendal/gor/blob/master/widgets.go 这里这些 js 可以单独写成 html 文件,后面引入进来吗?可以不要放到 go 源代码里面吗?

wendal commented 9 years ago

widgets.go 里面是内置的一些挂件

DrayChou commented 9 years ago

这些挂件我觉得都应该单独拿出来写成 html 模板文件。这样比较方便以后扩充挂件。毕竟你这里不可能把所有的挂件都写进去,而且有很多挂件都是个人的,也没法写进去的。

2015-01-16 10:46 GMT+08:00 Wendal Chen notifications@github.com:

widgets.go 里面是内置的一些挂件

— Reply to this email directly or view it on GitHub https://github.com/wendal/gor/issues/84#issuecomment-70200819.

wendal commented 9 years ago

这些只是内置的一些, 用户自定义的可以自由添加, 无需修改gor的代码的

wendal commented 9 years ago

估计你没看到widget的自定义机制...