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

Skip to content

Commit 91eb3d5

Browse files
committed
友情链接
1 parent f2a196f commit 91eb3d5

File tree

6 files changed

+76
-35
lines changed

6 files changed

+76
-35
lines changed

websites/code/studygolang/src/datamig/main.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

websites/code/studygolang/src/server/studygolang/background.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,23 @@ func ServeBackGround() {
2222
// 初始化 七牛云存储
2323
service.InitQiniu()
2424

25+
// 常驻内存的数据
2526
go loadData()
2627

2728
c := cron.New()
2829

30+
// 每天对非活跃用户降频
2931
c.AddFunc("@daily", decrUserActiveWeight)
3032

3133
// 两分钟刷一次浏览数(TODO:重启丢失问题?信号控制重启?)
3234
c.AddFunc("@every 2m", service.Views.Flush)
3335

36+
// 构建 solr 需要的索引数据
37+
// 一天一次全量
38+
c.AddFunc("0 20 0 * * *", func() {
39+
40+
})
41+
3442
c.Start()
3543
}
3644

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2014 The StudyGolang Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
// http://studygolang.com
5+
// Author:polaris [email protected]
6+
7+
package service
8+
9+
import (
10+
"logger"
11+
"model"
12+
)
13+
14+
// 准备索引数据,post 给 solr
15+
// isAll: 是否全量
16+
func Indexing(isAll bool) {
17+
18+
}
19+
20+
// 索引博文
21+
func IndexingArticle(isAll bool) {
22+
article := model.NewArticle()
23+
24+
if isAll {
25+
id := 0
26+
for {
27+
articleList, err := article.Where("id>?", id).FindAll()
28+
if err != nil {
29+
logger.Errorln("IndexingArticle error:", err)
30+
break
31+
}
32+
33+
if len(articleList) == 0 {
34+
break
35+
}
36+
37+
}
38+
}
39+
}

websites/code/studygolang/static/css/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ html, body { background: #F2F2F2; font-family: "Helvetica Neue", Helvetica, Aria
8585

8686
.sidebar .sb-content .stat-list ul { margin: 2px 15px; }
8787

88+
.sidebar .sb-content .image-list ul { margin: 2px 15px; }
89+
.sidebar .sb-content .image-list ul li { height: 95px; margin-top: 10px; }
90+
8891
/* blog 详情页 */
8992
.page {}
9093
.page .title { padding-top: 21px }
@@ -101,6 +104,7 @@ html, body { background: #F2F2F2; font-family: "Helvetica Neue", Helvetica, Aria
101104
.page .tags .list-inline li a {padding: 4px 12px;color: #fff;font-family: "NSimSun";font-size: 12px;background: #9F9F9F;border-radius: 3px;}
102105
.page .tags .list-inline li a:hover {background: #ED5565;text-decoration: none;}
103106
.page .content {margin: 0 30px;}
107+
.page .content img {width: 780px;}
104108
.page .orig-info {margin: 20px 30px 0 30px; border: 1px dashed #D5D5D5; padding: 10px; font-size: 13px; font-style: italic;}
105109
.page .active {border-bottom: 1px dotted #d8d8d8;padding-bottom: 20px;padding-top: 20px;margin: 0 30px;}
106110
.page .active .mark-like-btn .share-btn {height: 32px;-webkit-transition: background-color 0s;-moz-transition: background-color 0s;transition: background-color 0s;line-height: 32px;background: none;border: 1px solid;position: relative;color: #333;padding: 0px 16px 0px 36px;border-radius: 16px;font-family: "microsoft yahei";float: left;}

websites/code/studygolang/template/common/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h3>
3131
<a href="/"><img alt="Text_logo" src="/static/img/text_logo.png" style="width:123px;height:29px;"></a>
3232
</h3>
3333
<ul class="nav">
34-
<li class="first {{.activeTopics}}"><a href="/topics">社区</a></li><li><a href="http://blog.studygolang.com">博客</a></li><li class="{{.activeResources}}"><a href="/resources">资源</a></li><li class="{{.activeWiki}}"><a href="/wiki">Wiki</a></li><li class="{{.activeSites}}"><a href="/sites">酷站</a></li><li><a href="http://docs.studygolang.com">官方文档</a><li class="new"><a href="http://docscn.studygolang.com">中文文档</a><sup></sup></li><li class="last {{.activeUsers}}"><a href="/users">会员</a></li>
34+
<li class="first {{.activeTopics}}"><a href="/topics">社区</a></li><li><a href="/articles">博客</a></li><li class="{{.activeResources}}"><a href="/resources">资源</a></li><li class="{{.activeWiki}}"><a href="/wiki">Wiki</a></li><li class="{{.activeSites}}"><a href="/sites">酷站</a></li><li><a href="http://docs.studygolang.com">官方文档</a><li class="new"><a href="http://docscn.studygolang.com">中文文档</a><sup></sup></li><li class="last {{.activeUsers}}"><a href="/users">会员</a></li>
3535
</ul>
3636
<form action="/search" class="navbar-search pull-left" method="get">
3737
<input type="text" name="q" class="search-query span2" value="" placeholder="搜索">

websites/code/studygolang/template/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,30 @@ <h3 class="title"><i class="glyphicon glyphicon-stats"></i>&nbsp;&nbsp;统计信
322322
</div>
323323
</div>
324324
</div>
325+
326+
<div class="row box_white sidebar">
327+
<div class="top">
328+
<h3 class="title"><i class="glyphicon glyphicon-link"></i>&nbsp;友情链接</h3>
329+
</div>
330+
<div class="sb-content">
331+
<div class="image-list">
332+
<ul class="list-unstyled">
333+
<li>
334+
<a href="http://gopm.io/" target="_blank" title="Go 语言包管理">
335+
Go 语言包管理 — 不用翻墙就能下载 Go 语言包
336+
</a>
337+
</li>
338+
<!--
339+
<li>
340+
<a href="/" target="_blank" title="">
341+
<img src="" width="242" height="95">
342+
</a>
343+
</li>
344+
-->
345+
</ul>
346+
</div>
347+
</div>
348+
</div>
325349

326350
</div>
327351
</div>

0 commit comments

Comments
 (0)