Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37a65bd

Browse files
committed
文章使用 tag形式
1 parent 5c33cba commit 37a65bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

template/new_index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,12 @@
134134
{{if .Top}}
135135
<span style="color: #ff7700; border: 1px solid #ff7700;">置顶</span>
136136
{{end}}
137-
<a class="node" href="/articles">文章</a> &nbsp;•&nbsp;
137+
{{if .Tags}}
138+
{{$tags := explode .Tags ","}}
139+
<a class="node" href="/tag/{{index $tags 0}}">{{index $tags 0}}</a>
140+
{{else}}
141+
<a class="node" href="/articles">文章</a> &nbsp;•&nbsp;
142+
{{end}}
138143
{{if .IsSelf}}
139144
<strong><a href="/user/{{.User.Username}}" class="noul">{{.User.Username}}</a></strong>
140145
{{else}}

0 commit comments

Comments
 (0)