leanote博客模板的语法是golang模板语法, golang模板语法简洁, 很快就会上手, 大家可以参考leanote自带的主题模板.
一些最基本的用法:
{{$.blogInfo.UserId}} 表示输出blogInfo.UserId变量, 比如 <span>{{$.blogInfo.UserId}}</span>{{if $.blogInfo.OpendComment}} 为真的处理 {{else}} 为假为处理 {{end}}{{range $.posts}} {{.Title}} {{end}} range循环输出所有文章标题{{$.post.CreatedTime|datetime}} 使用datetime函数来模式化时间, 会输出类似 2014-11-5 12:33:22 的数据关于golang模板更多信息请查看 "golang模板语法帮助"
标准的leanote主题模板组织结构如下, 其中header.html, footer.html, paging.html, share_comment.html, highlight.html 这些仅供其它模板引用, 可以不需要.
公用变量表示在每个页面都可以使用的变量