7
7
< li > < a href ="/ "> 首页</ a > </ li >
8
8
< li class ="active "> 文章</ li >
9
9
</ ol >
10
- {{range .articles}}
10
+ {{range $i, $article := .articles}}
11
11
< article class ="article box_white ">
12
12
< div class ="row ">
13
13
{{if .Cover}}
@@ -70,7 +70,17 @@ <h2><a href="/articles/{{.Id}}" target="_blank" title="{{.Title}}">
70
70
</ div >
71
71
</ div >
72
72
</ article >
73
- {{else}}
73
+
74
+ {{if eq (mod $i 6) 3}}
75
+ {{if $.pos_ad.feed}}
76
+ < article class ="article box_white ">
77
+ {{if eq $.pos_ad.feed.AdType 0}}
78
+ {{noescape $.pos_ad.feed.Code}}
79
+ {{end}}
80
+ </ article >
81
+ {{end}}
82
+ {{end}}
83
+
74
84
< article class ="article box_white ">
75
85
< div class ="row "> 暂无博文,< a class ="btn btn-default btn-sm " href ="/articles/new "> 撰写文章</ a > </ div >
76
86
</ article >
@@ -88,8 +98,6 @@ <h2><a href="/articles/{{.Id}}" target="_blank" title="{{.Title}}">
88
98
< div class ="sep20 "> </ div >
89
99
{{include "common/my_info.html" .}}
90
100
91
- {{include "sidebar/view_rank.html" (parseJSON `{"rank_title":"今日阅读排行","objtype":1,"limit":10,"rank_type":"today"}`)}}
92
-
93
101
{{if .pos_ad.right1}}
94
102
< div class ="box_white sidebar " id ="ad-right1 ">
95
103
{{if eq .pos_ad.right1.AdType 0}}
@@ -98,6 +106,8 @@ <h2><a href="/articles/{{.Id}}" target="_blank" title="{{.Title}}">
98
106
</ div >
99
107
{{end}}
100
108
109
+ {{include "sidebar/view_rank.html" (parseJSON `{"rank_title":"今日阅读排行","objtype":1,"limit":10,"rank_type":"today"}`)}}
110
+
101
111
{{include "sidebar/view_rank.html" (parseJSON `{"rank_title":"一周阅读排行","objtype":1,"limit":10,"rank_type":"week"}`)}}
102
112
103
113
{{if .pos_ad.right2}}
@@ -126,4 +136,4 @@ <h2><a href="/articles/{{.Id}}" target="_blank" title="{{.Title}}">
126
136
{{end}}
127
137
{{end}}
128
138
129
- {{end}}
139
+ {{end}}
0 commit comments