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

Skip to content

Commit d1137cf

Browse files
committed
bugfix
1 parent f3a09cf commit d1137cf

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

config/init.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ VALUES
5353
(40, '常规', 39, 0, '/admin/setting/genneral/modify', '', '2017-05-21 16:05:00', '2017-05-21 16:05:46'),
5454
(41, '导航', 39, 0, '/admin/setting/nav/modify', '', '2017-05-21 18:01:00', '2017-05-21 18:01:16');
5555

56-
INSERT INTO `website_setting` (`id`, `name`, `domain`, `title_suffix`, `favicon`, `logo`, `start_year`, `blog_url`, `reading_menu`, `docs_menu`, `slogan`, `beian`, `friends_logo`, `footer_nav`, `project_df_logo`, `created_at`, `updated_at`)
56+
INSERT INTO `website_setting` (`id`, `name`, `domain`, `title_suffix`, `favicon`, `logo`, `start_year`, `blog_url`, `reading_menu`, `docs_menu`, `slogan`, `beian`, `friends_logo`, `footer_nav`, `project_df_logo`, `index_nav`, `created_at`, `updated_at`)
5757
VALUES
58-
(1, 'Go语言中文网', 'studygolang.com', '- Go语言中文网 - Golang中文社区', '/static/img/go.ico', '/static/img/logo1.png', 2013, 'http://blog.studygolang.com', '', '', 'Go语言中文网,中国 Golang 社区,致力于构建完善的 Golang 中文社区,Go语言爱好者的学习家园。', '京ICP备14030343号-1', '[{\"image\":\"http://qiniutek.com/images/logo-2.png\",\"url\":\"https://portal.qiniu.com/signup?code=3lfz4at7pxfma\",\"name\":\"\",\"width\":\"290px\",\"height\":\"45px\"}]', '[{\"name\":\"关于\",\"url\":\"/wiki/about\",\"outer_site\":false},{\"name\":\"贡献者\",\"url\":\"/wiki/contributors\",\"outer_site\":false},{\"name\":\"帮助推广\",\"url\":\"/wiki\",\"outer_site\":false},{\"name\":\"反馈\",\"url\":\"/topics/node/16\",\"outer_site\":false},{\"name\":\"Github\",\"url\":\"https://github.com/studygolang\",\"outer_site\":true},{\"name\":\"新浪微博\",\"url\":\"http://weibo.com/studygolang\",\"outer_site\":true},{\"name\":\"内嵌Wide\",\"url\":\"/wide/playground\",\"outer_site\":false},{\"name\":\"免责声明\",\"url\":\"/wiki/duty\",\"outer_site\":false}]', '', '2017-05-21 10:22:00', '2017-05-21 21:30:56');
58+
(1, 'Go语言中文网', 'studygolang.com', '- Go语言中文网 - Golang中文社区', '/static/img/go.ico', '/static/img/logo1.png', 2013, 'http://blog.studygolang.com', '', '', 'Go语言中文网,中国 Golang 社区,致力于构建完善的 Golang 中文社区,Go语言爱好者的学习家园。', '京ICP备14030343号-1', '[{\"image\":\"http://qiniutek.com/images/logo-2.png\",\"url\":\"https://portal.qiniu.com/signup?code=3lfz4at7pxfma\",\"name\":\"\",\"width\":\"290px\",\"height\":\"45px\"}]', '[{\"name\":\"关于\",\"url\":\"/wiki/about\",\"outer_site\":false},{\"name\":\"贡献者\",\"url\":\"/wiki/contributors\",\"outer_site\":false},{\"name\":\"帮助推广\",\"url\":\"/wiki\",\"outer_site\":false},{\"name\":\"反馈\",\"url\":\"/topics/node/16\",\"outer_site\":false},{\"name\":\"Github\",\"url\":\"https://github.com/studygolang\",\"outer_site\":true},{\"name\":\"新浪微博\",\"url\":\"http://weibo.com/studygolang\",\"outer_site\":true},{\"name\":\"内嵌Wide\",\"url\":\"/wide/playground\",\"outer_site\":false},{\"name\":\"免责声明\",\"url\":\"/wiki/duty\",\"outer_site\":false}]', '', '{["tab":"all"]}', '2017-05-21 10:22:00', '2017-05-21 21:30:56');
5959

6060
INSERT INTO `friend_link` (`id`, `name`, `url`, `seq`, `logo`, `created_at`)
6161
VALUES

src/http/http.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ var funcMap = template.FuncMap{
9191
t, _ := time.Parse("2006-01-02 15:04:05", ctime)
9292
return t.Format(time.RFC3339) + "+08:00"
9393
},
94+
"hasPrefix": func(s, prefix string) bool {
95+
if strings.HasPrefix(s, prefix) {
96+
return true
97+
}
98+
return false
99+
},
94100
"substring": util.Substring,
95101
"add": func(nums ...interface{}) int {
96102
total := 0

template/topics/node.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="box_white">
1313
<div class="node-info">
1414
{{if .node.logo}}
15-
<div style="float: left; display: inline-block; margin-right: 10px; margin-bottom: initial!important;"><img src="{{.cdn_domain}}/{{.node.logo}}?imageView2/2/w/50" border="0" align="default" width="50"></div>
15+
<div style="float: left; display: inline-block; margin-right: 10px; margin-bottom: initial!important;"><img src="{{if hasPrefix .node.logo "http"}}{{.node.logo}}{{else}}{{.cdn_domain}}/{{.node.logo}}{{end}}?imageView2/2/w/50" border="0" align="default" width="50"></div>
1616
{{end}}
1717
<div style="float: right; margin-top: 10px;"><a href="/topics/new?nid={{.node.nid}}" class="btn btn-default btn-sm">发布新主题</a></div>
1818
<div class="title">

0 commit comments

Comments
 (0)