Skip to content

Commit 2f8ec10

Browse files
committed
Bootstrap
1 parent 3d50df0 commit 2f8ec10

22 files changed

+452
-1
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ _cgo_export.*
2020
_testmain.go
2121

2222
*.exe
23+
*.exe~
24+
.DS_Store
25+
.vendor/
26+
gcblog

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
gcblog
22
======
33

4-
An open source project for Go China blog.
4+
An open source project for Golang China blog.

bee.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": 0,
3+
"gopm": {
4+
"enable": true,
5+
"install": true
6+
},
7+
"go_install": false,
8+
"watch_ext": [],
9+
"dir_structure": {
10+
"controllers": "",
11+
"models": "",
12+
"others": []
13+
},
14+
"cmd_args": [],
15+
"envs": []
16+
}

conf/app.conf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
appname = Go China Blog

controllers/base.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2013 gcblog authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"): you may
4+
// not use this file except in compliance with the License. You may obtain
5+
// a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
// License for the specific language governing permissions and limitations
13+
// under the License.
14+
15+
package controllers
16+
17+
import (
18+
"github.com/astaxie/beego"
19+
)
20+
21+
type baseController struct {
22+
beego.Controller
23+
}

controllers/home.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2013 gcblog authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"): you may
4+
// not use this file except in compliance with the License. You may obtain
5+
// a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
// License for the specific language governing permissions and limitations
13+
// under the License.
14+
15+
package controllers
16+
17+
type HomeController struct {
18+
baseController
19+
}
20+
21+
func (this *HomeController) Get() {
22+
this.TplNames = "home.html"
23+
}

gcblog.go

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright 2013 gcblog authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"): you may
4+
// not use this file except in compliance with the License. You may obtain
5+
// a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
// License for the specific language governing permissions and limitations
13+
// under the License.
14+
15+
// An open source project for Golang China blog.
16+
package main
17+
18+
import (
19+
"github.com/astaxie/beego"
20+
21+
"github.com/Unknwon/gcblog/controllers"
22+
)
23+
24+
const (
25+
APP_VER = "0.0.1.1212"
26+
)
27+
28+
func main() {
29+
beego.Info(beego.AppName, APP_VER)
30+
31+
// Register routers.
32+
beego.Router("/", &controllers.HomeController{})
33+
34+
beego.Run()
35+
}

static/css/bootstrap.min.css

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/css/gcblog.css

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*!
2+
* Golang China Blog (http://blog.go-china.org)
3+
* Copyright 2013 Golang China Blog.
4+
* Licensed under http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
body {
8+
padding-top: 70px;
9+
}
10+
.navbar-gcblog {
11+
background-color: #2894FF;
12+
border-color: #0072E3;
13+
}
14+
.navbar-brand {
15+
color: white;
16+
}
17+
.navbar-brand:hover {
18+
color: white;
19+
}
20+
.navbar-nav > li > a {
21+
color: white;
22+
}
23+
.navbar-nav > li > a:hover, .nav > li > a:focus {
24+
background-color: #0072E3;
25+
}
26+
.navbar-nav > .active {
27+
background-color: #0072E3;
28+
}
29+
.widget h4 {
30+
display: block;
31+
background: #2894FF;
32+
color: white;
33+
text-transform: capitalize;
34+
border: 1px solid #0072E3;
35+
margin-bottom: 10px;
36+
text-align: center;
37+
padding: 10px 5px;
38+
}
19.8 KB
Binary file not shown.

static/fonts/glyphicons-halflings-regular.svg

+229
Loading
40.3 KB
Binary file not shown.
22.7 KB
Binary file not shown.

static/img/favicon.png

2.42 KB
Loading

static/js/bootstrap.min.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/jquery-1.10.1.min.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/jquery-1.10.1.min.map

+1
Large diffs are not rendered by default.

views/base/base.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
{{template "base/head.html" .}}
5+
{{template "head" .}}
6+
</head>
7+
<body>
8+
{{template "base/navbar.html" .}}
9+
{{template "body" .}}
10+
{{template "base/footer.html" .}}
11+
</body>
12+
</html>

views/base/footer.html

Whitespace-only changes.

views/base/head.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
2+
<link rel="shortcut icon" href="/static/img/favicon.png" />
3+
<meta name="author" content="Unknown" />
4+
<meta name="description" content="Golang 中国博客" />
5+
<meta name="keywords" content="Go, golang, beego, 博客, 中国">
6+
7+
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
8+
<link href="/static/css/gcblog.css" rel="stylesheet" />
9+
<script src="/static/js/jquery-1.10.1.min.js"></script>

views/base/navbar.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<nav class="navbar navbar-gcblog navbar-fixed-top">
2+
<div class="container">
3+
<div class="navbar-header">
4+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-8">
5+
<span class="sr-only">导航栏</span>
6+
<span class="icon-bar"></span>
7+
<span class="icon-bar"></span>
8+
<span class="icon-bar"></span>
9+
</button>
10+
<a class="navbar-brand" href="/">Golang 中国博客</a>
11+
</div>
12+
<ul class="nav navbar-nav">
13+
<li class="active"><a href="/">首页</a></li>
14+
</ul>
15+
</nav>
16+
</div>

views/home.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{template "base/base.html" .}}
2+
{{define "head"}}
3+
<title>首页 - Golang 中国博客</title>
4+
{{end}}
5+
{{define "body"}}
6+
<div class="container">
7+
<div class="row">
8+
<div class="col-sm-9">
9+
你好,世界!
10+
</div>
11+
12+
<div class="col-sm-3">
13+
<div class="widget">
14+
<h4>关于我们</h4>
15+
</div>
16+
17+
<div class="widget">
18+
<h4>文章列表</h4>
19+
<a href="/archive"></a>
20+
</div>
21+
</div>
22+
</div>
23+
</div>
24+
{{end}}

0 commit comments

Comments
 (0)