golang学习之go简单博客应用
{{set . "title" "博客详情"}}
{{set . "home" "active" }}
{{.title}}
{{template "header.html" .}}
{{if .blog}}
{{.blog.Title}}
作者:{{.blog.Author}}
日期:{{.blog.CDate.Format "2006-01-02 15:04"}}
阅读:{{.blog.ReadCnt}}
{{.blog.Content}}
{{if .comments}}
回复
{{range $index,$comment := .comments}}
#{{pls $index 1}}
{{$comment.Email}}
日期:{{$comment.CDate.Format "2006-01-02 15:04" }}
{{$comment.Content}}
{{end}}
{{end}}
邮箱
{{with $field := field "comment.Email" .}}
{{$field.Error}}
{{end}}
评论
{{with $field := field "comment.Content" .}}
{{if $field.Flash}}{{$field.Flash}}{{else}}{{$field.Value}}{{end}}
{{end}}
提交
{{end}}
{{template "footer.html" .}}
页:
[1]