1
+ {{define "title"}}搜索{{end}}
2
+ {{define "seo"}}< meta name ="keywords " content ="Go语言博客文章, Go语言博文, Go语言, Golang, Go中文社区,Golang中文社区, Go语言社区, Go语言学习园地 ">
3
+ < meta name ="description " content ="文章来自国内知名网站知名,Go爱好者学习笔记,经验分享;也有爱好者自己的博客文章,已经一些国外精彩文章。 "> {{end}}
4
+ {{define "content"}}
5
+ < div class ="row header_title ">
6
+ < div class ="col-lg-12 col-md-12 col-sm-12 search-box ">
7
+ < div class ="box_white ">
8
+ < form action ="" class ="search-form ">
9
+ < div >
10
+ < div class ="col-xs-2 ">
11
+ </ div >
12
+ < div class ="col-xs-6 ">
13
+ < input type ="text " class ="form-control " name ="q " placeholder ="输入搜索词 " />
14
+ </ div >
15
+ < div class ="col-xs-1 ">
16
+ < button type ="button " class ="btn btn-default "> 搜索</ button >
17
+ </ div >
18
+ </ div >
19
+ < div class ="clearfix ">
20
+ < div class ="col-xs-2 ">
21
+ </ div >
22
+ < div class ="col-xs-6 ">
23
+ < div class ="radio ">
24
+ < label >
25
+ < input type ="radio " name ="f " checked ="checked " /> 全文
26
+ </ label >
27
+ < label >
28
+ < input type ="radio " name ="f " /> 标题
29
+ </ label >
30
+ < label >
31
+ < input type ="radio " name ="f " /> 作者
32
+ </ label >
33
+ </ div >
34
+ </ div >
35
+ </ div >
36
+ </ form >
37
+ </ div >
38
+ </ div >
39
+ </ div >
40
+ < div class ="row ">
41
+ < div class ="col-lg-9 col-md-8 col-sm-7 ">
42
+ {{range .docs}}
43
+ < article class ="article box_white ">
44
+ < div class ="row ">
45
+ < div >
46
+ < h2 > < a href ="/articles/{{.Objid}} " target ="_blank " title ="{{.Title}} "> {{.Title}}</ a > </ h2 >
47
+ < p class ="text "> {{substring .Content 250 "..."}}< a href ="/articles/{{.Objid}} " target ="_blank " title ="阅读全文 "> 阅读全文</ a > </ p >
48
+ </ div >
49
+ </ div >
50
+ < div class ="row ">
51
+ < div class ="col-md-8 metatag ">
52
+ < i class ="glyphicon glyphicon-calendar "> </ i >
53
+ < span class ="date " title ="发布日期 "> {{.PubTime}}</ span >
54
+ < i class ="glyphicon glyphicon-user "> </ i >
55
+ < span class ="author " title ="作者 "> {{.Author}}</ span >
56
+ {{if .Tags}}
57
+ {{$tags := explode .Tags ","}}
58
+ < ul class ="list-inline ">
59
+ < i class ="glyphicon glyphicon-tags "> </ i >
60
+ {{range $tag := $tags}}
61
+ < li >
62
+ < a href ="/ " title ="{{$tag}} " target ="_blank ">
63
+ {{$tag}}
64
+ </ a >
65
+ </ li >
66
+ {{end}}
67
+ </ ul >
68
+ {{end}}
69
+ </ div >
70
+ < div class ="col-md-4 metatag text-right ">
71
+ < span class ="view " title ="阅读数 ">
72
+ < i class ="glyphicon glyphicon-eye-open "> </ i >
73
+ 阅读:< span > {{.Viewnum}}</ span > 次
74
+ </ span >
75
+ < a href ="/articles/{{.Id}}#commentForm " class ="cmt " target ="_blank " title ="评论数 ">
76
+ < i class ="glyphicon glyphicon-comment "> </ i >
77
+ 评论:< span > {{.Cmtnum}}</ span > 条
78
+ </ a >
79
+ {{if $.likeflags}}
80
+ {{$likeFlag := index $.likeflags .Id}}
81
+ < a href ="# " class ="like{{if $likeFlag}} hadlike{{end}} " title ="{{if $likeFlag}}取消喜欢{{else}}我喜欢{{end}} " data-objid ="{{.Id}} " data-objtype ="1 " data-flag ="{{if $likeFlag}}{{$likeFlag}}{{else}}0{{end}} ">
82
+ < i class ="glyphicon glyphicon-heart{{if not $likeFlag}}-empty{{end}} "> </ i >
83
+ {{else}}
84
+ < a href ="# " class ="like " title ="我喜欢 " data-objid ="{{.Id}} " data-objtype ="1 " data-flag ="0 ">
85
+ < i class ="glyphicon glyphicon-heart-empty "> </ i >
86
+ {{end}}
87
+ < span class ="likenum "> {{.Likenum}}</ span > 人喜欢
88
+ </ a >
89
+ </ div >
90
+ </ div >
91
+ </ article >
92
+ {{end}}
93
+ < ul class ="pager ">
94
+ {{if .page.has_prev}}
95
+ < li class ="previous "> < a href ="/articles?lastid={{.page.prev_id}} "> ← 上一页</ a > </ li >
96
+ {{end}}
97
+ {{if .page.has_next}}
98
+ < li class ="next "> < a href ="/articles?lastid={{.page.next_id}} "> 下一页 →</ a > </ li >
99
+ {{end}}
100
+ </ ul >
101
+ </ div >
102
+ < div class ="col-lg-3 col-md-4 col-sm-5 ">
103
+ < div class ="row box_white sidebar ">
104
+ < div class ="top ">
105
+ < ul class ="list-inline text-center ">
106
+ < li class ="first "> < a href ="/topics " target ="_blank " class ="cur " title ="点击更多 "> 最新帖子</ a > |</ li >
107
+ < li class ="second "> < a href ="/resources " target ="_blank " title ="点击更多 "> 最新资源</ a > |</ li >
108
+ < li class ="last "> < a href ="javascript:; "> 最新评论</ a > </ li >
109
+ </ ul >
110
+ < p class ="bar "> </ p >
111
+ </ div >
112
+ < div class ="sb-content ">
113
+ < div class ="topic-list first ">
114
+ < ul class ="list-unstyled ">
115
+ < img src ="/static/img/loaders/loader7.gif " alt ="加载中 " />
116
+ </ ul >
117
+ </ div >
118
+ < div class ="resource-list second hidden ">
119
+ < ul class ="list-unstyled ">
120
+ </ ul >
121
+ </ div >
122
+ < div class ="cmt-list last hidden ">
123
+ < ul class ="list-unstyled ">
124
+ </ ul >
125
+ </ div >
126
+ </ div >
127
+ </ div >
128
+ </ div >
129
+ </ div >
130
+ {{end}}
131
+ {{define "js"}}
132
+ < script type ="text/javascript ">
133
+ // 需要加载的侧边栏
134
+ SG . SIDE_BARS = [
135
+ "/topics/recent.json" ,
136
+ "/resources/recent.json" ,
137
+ "/comments/recent.json" ,
138
+ ] ;
139
+ </ script >
140
+ {{end}}
0 commit comments