Skip to content
This repository was archived by the owner on Jun 21, 2019. It is now read-only.

Commit bbd0fb3

Browse files
committed
add links
1 parent c4e30c2 commit bbd0fb3

File tree

7 files changed

+79
-3
lines changed

7 files changed

+79
-3
lines changed

actions/link.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package actions
2+
3+
import
4+
5+
// DocsRouter serves about page.
6+
"github.com/go-xweb/xweb"
7+
8+
type LinkAction struct {
9+
baseAction
10+
11+
get xweb.Mapper `xweb:"/"`
12+
}
13+
14+
func (l *LinkAction) Get() error {
15+
return l.Render("link.html", &xweb.T{
16+
"IsLink": true,
17+
})
18+
}

conf/locale_en-US.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ home = Home
77
about = About
88
team = Team
99
community = Community
10+
link = Links
1011
getting started = Getting started
1112
docs = Documentation
1213
blog = Blog
@@ -34,3 +35,4 @@ quick_start = Quick Start
3435
further_reading = Driver Supports
3536
features = Features
3637
who_are_use = Well-known Customers
38+
friends = Friend Sites

conf/locale_zh-CN.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ home = 首页
77
about = 关于
88
team = 团队
99
community = 开发者社区
10+
link = 文章
1011
getting started = 快速入门
1112
docs = 使用手册
1213
blog = 官方博客
@@ -36,3 +37,4 @@ quick_start = 快速开始
3637
further_reading = 驱动支持
3738
features = 产品优势
3839
who_are_use = 知名 Xorm 用户
40+
friends = 友情链接

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func main() {
3232

3333
// Register routers.
3434
xweb.AddAction(&actions.HomeAction{})
35-
xweb.AutoAction(&actions.DocsAction{})
35+
xweb.AutoAction(&actions.DocsAction{}, &actions.LinkAction{})
3636
xweb.AddTmplVars(&xweb.T{
3737
"i18n": i18n.Tr,
3838
"IsPro": isPro,

templates/base/navbar.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</a>
2222
<div class="visible-xs text-center">
2323
<a class="navbar-brand" href="/">
24-
Gogs
24+
Xorm
2525
</a>
2626
{{if not .T.IsHome}}
2727
<span class="nav-github">
@@ -36,6 +36,7 @@
3636
<!-- <li {{if .T.IsQuickStart}}class="active"{{end}}><a href="/quickstart">{{i18n .Lang "getting started"}}</a></li> -->
3737
<!-- <li {{if .T.IsCommunity}}class="active"{{end}}><a href="/community">{{i18n .Lang "community"}}</a></li> -->
3838
<li {{if .T.IsDocs}}class="active"{{end}}><a href="/docs/intro/">{{i18n .Lang "docs"}}</a></li>
39+
<li {{if .T.IsLink}}class="active"{{end}}><a href="/link/">{{i18n .Lang "link"}}</a></li>
3940
<li ><a target="_blank" href="http://{{i18n .Lang "blog_url"}}">{{i18n .Lang "blog"}}</a></li>
4041
</ul>
4142
<div class="hidden-sm hidden-xs nav-lang pull-right">

templates/home.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@ <h2>{{i18n .Lang "home.quick_start"}}</h2>
4545
<p><code>go get github.com/go-xorm/xorm</code></p>
4646
<p>Xorm工具</p>
4747
<p><code>go get github.com/go-xorm/cmd/xorm</code></p>
48+
<p>源码文档</p>
49+
<p><a href="http://gowalker.org/github.com/go-xorm/xorm" target="_blank">gowalker.org/github.com/go-xorm/xorm</a></p>
50+
<p><a href="http://godoc.org/github.com/go-xorm/xorm" target="_blank">godoc.org/github.com/go-xorm/xorm</a></p>
4851
{{else}}
4952
<p>Library Installation</p>
5053
<p><code>go get github.com/go-xorm/xorm</code></p>
5154
<p>Xorm Tools Installation</p>
5255
<p><code>go get github.com/go-xorm/cmd/xorm</code></p>
56+
<p>Source Document</p>
57+
<p><code>go get github.com/go-xorm/xorm</code></p>
58+
<p>Xorm Tools Installation</p>
59+
<p><code>go get github.com/go-xorm/cmd/xorm</code></p>
5360
{{end}}
5461
</div>
5562
</div>
@@ -182,7 +189,7 @@ <h3 class="title">
182189

183190
<div class="container">
184191
<div class="row home-box">
185-
<div class="col-md-12">
192+
<div class="col-md-8">
186193
<h2>{{i18n .Lang "home.who_are_use"}}</h2>
187194
<div class="whouse">
188195
<a target="_blank" href="http://gogs.io/"><img class="img-thumbnail" src="/img/brands/gogs.png"/></a>
@@ -191,6 +198,13 @@ <h2>{{i18n .Lang "home.who_are_use"}}</h2>
191198
<a target="_blank" href="https://github.com/zzdboy/GoCMS"><img class="img-thumbnail" src="/img/brands/gocms.png"/></a>
192199
</div>
193200
</div>
201+
202+
<div class="col-md-4">
203+
<h2>{{i18n .Lang "home.friends"}}</h2>
204+
<div class="whouse">
205+
<a target="_blank" href="http://gogs.io/">Go Daily</a>
206+
</div>
207+
</div>
194208
</div>
195209
</div>
196210
{{include "base/footer.html"}}

templates/link.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
{{include "base/head.html"}}
5+
<title>{{i18n .Lang "homepage"}} - xorm: {{i18n .Lang "app_intro"}}</title>
6+
<link rel="stylesheet" href="/css/bootstrap.css">
7+
<link rel="stylesheet" href="/css/bootstrap-theme.css" />
8+
<link rel="stylesheet" href="/css/font-awesome.min.css" />
9+
<link rel="stylesheet" href="/css/prettify.css" />
10+
<link rel="stylesheet" href="/css/select2.css" />
11+
12+
<link rel="stylesheet" href="/css/base.css">
13+
<link rel="stylesheet" href="/css/markdown.css">
14+
<link rel="stylesheet" href="/css/main.css">
15+
</head>
16+
<body id="front">
17+
<div id="wrapper">
18+
{{include "base/navbar.html"}}
19+
<div id="main">
20+
<div class="container main-container">
21+
<div class="row">
22+
<div class="col-md-12">
23+
<ul>
24+
<li>[2014-06-17] <a href="http://obahua.com/xorm-go-orm-advanced-usage/" target="_blank">XORM - Go ORM: advanced usage</a></li>
25+
<li>[2014-06-01] <a href="http://wuwen.org/article/36/02-xorm-class2.html" target="_blank">xorm - 课时 2:高级用法讲解</a></li>
26+
<li>[2014-05-09] <a href="http://obahua.com/xorm-go-orm-basic-guide/" target="_blank">XORM - Go ORM: basic guide</a></li>
27+
<li>[2014-04-21] <a href="http://www.tudou.com/programs/view/HRUEtXXV_QM/" target="_blank">《Go名库讲解》02-xorm 课时1:常见用法指导</a></li>
28+
<li>[2014-04-05] <a href="http://wuwen.org/article/28/02-xorm-class1.html">xorm - 课时 1:常见用法指导</a></li>
29+
<li>[2014-03-10] <a href="http://my.oschina.net/goskyblue/blog/206799">Xorm 速记卡</a></li>
30+
<li>[2014-01-02] <a href="http://blog.go-china.org/02-go_xorm" target="_blank">XORM的七种武器</a></li>
31+
</ul>
32+
</div>
33+
</div>
34+
</div>
35+
</div>
36+
{{include "base/footer.html"}}
37+
</div>
38+
</body>
39+
</html>

0 commit comments

Comments
 (0)