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

Skip to content

Commit 7ddeae2

Browse files
committed
导航栏显示优化;新增 package.json
1 parent 0a72b1b commit 7ddeae2

27 files changed

+87
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ studygolang_data.sql
4343
welcome.png
4444

4545
*.json
46+
!package.json
4647

4748
.DS_Store
4849
/env.ini

gulpfile.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ var gulp=require('gulp'), // gulp 基础库
55
uglify=require('gulp-uglify'), // js压缩
66
rename=require('gulp-rename'), // 文件重命名
77
jshint=require('gulp-jshint'), // js检查
8+
// rev=require('gulp-rev-ayou'), // 根据文件内容生成版本号 暂时先不加
9+
// revCollector=require('gulp-rev-collector-ayou'), // 替换模板中的静态文件为带有版本号的
810
notify=require('gulp-notify'); // 提示
911

1012
gulp.task('default', function() {
@@ -16,10 +18,13 @@ gulp.task('minifycss', function() {
1618
gulp.src('static/css/*.css') // 设置 css
1719
.pipe(concat('sg_styles.css')) // 合并 css 文件到 "sg_styles.css"
1820
.pipe(gulp.dest('static/dist/css')) // 设置输出路径
21+
// .pipe(rev()) // 求版本号
1922
.pipe(rename({suffix:'.min'})) // 修改文件名
2023
.pipe(minifycss()) // 压缩文件
2124
.pipe(gulp.dest('static/dist/css')) // 输出文件目录
22-
.pipe(notify({message:'css task ok'})); // 提示成功
25+
// .pipe(rev.manifest()) // 收集原始文件名和版本号文件名对应关系
26+
.pipe(gulp.dest('static/dist/rev/js')) // 对应文件输出
27+
.pipe(notify({message:'css task ok'})) // 提示成功
2328

2429
gulp.src('static/css/libs/*.css') // 设置 css
2530
.pipe(concat('sg_libs.css')) // 合并 css 文件到 "sg_libs.css"
@@ -49,10 +54,13 @@ gulp.task('minifyjs',function(){
4954

5055
gulp.src(['static/js/base/common.js', 'static/js/base/md_toolbar.js', 'static/js/base/puploader.js', 'static/js/base/upload.js', 'static/js/base/comment.js']) // 选择合并的 JS
5156
.pipe(concat('sg_base.js')) // 合并 JS
52-
.pipe(gulp.dest('static/dist/js')) // 输出
57+
.pipe(gulp.dest('static/dist/js')) // 输出
58+
// .pipe(rev()) // 求版本号
5359
.pipe(rename({suffix:'.min'})) // 重命名
5460
.pipe(uglify()) // 压缩
55-
.pipe(gulp.dest('static/dist/js')) // 输出
61+
.pipe(gulp.dest('static/dist/js')) // 输出
62+
// .pipe(rev.manifest()) // 收集原始文件名和版本号文件名对应关系
63+
.pipe(gulp.dest('static/dist/rev/css')) // 对应文件输出
5664
.pipe(notify({message:"js base task ok"})); // 提示成功
5765

5866
///////// 只是压缩 /////////////

package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "studygolang",
3+
"version": "1.0.0",
4+
"description": "studygolang =========== [![Build Status](https://travis-ci.org/studygolang/studygolang.svg?branch=master)](https://travis-ci.org/studygolang/studygolang)",
5+
"main": "gulpfile.js",
6+
"directories": {
7+
"doc": "docs"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/studygolang/studygolang.git"
15+
},
16+
"author": "",
17+
"license": "ISC",
18+
"bugs": {
19+
"url": "https://github.com/studygolang/studygolang/issues"
20+
},
21+
"homepage": "https://github.com/studygolang/studygolang#readme",
22+
"devDependencies": {
23+
"gulp": "^3.9.1",
24+
"gulp-concat": "^2.6.1",
25+
"gulp-jshint": "^2.1.0",
26+
"gulp-minify-css": "^1.2.4",
27+
"gulp-notify": "^3.2.0",
28+
"gulp-rename": "^1.2.2",
29+
"gulp-rev-ayou": "^1.0.1",
30+
"gulp-rev-collector-ayou": "^1.0.0",
31+
"gulp-uglify": "^3.0.0",
32+
"jshint": "^2.9.5"
33+
}
34+
}

static/css/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ a.tab_current:hover {background-color: #445; color: #fff; text-decoration: none;
3131
.clr:after {clear: both;content: '\0020';display: block;visibility: hidden;height: 0;}
3232

3333
/* nav */
34+
.navbar-default { position: static; }
3435
.navbar-default .navbar-nav>li>a { color: #bbbbbb; }
3536
.navbar-default .navbar-nav>.active>a { color: #ffffff; }
3637

@@ -39,7 +40,7 @@ a.tab_current:hover {background-color: #445; color: #fff; text-decoration: none;
3940
.navbar-header .navbar-brand { margin-top: -5px; }
4041
.navbar-header .navbar-brand img { width: 123px;height: 29px; }
4142

42-
.wrapper {margin-top: 52px;}
43+
/* .wrapper {margin-top: 52px;} */
4344

4445
.box_white { background: #FFF; clear: both; overflow: hidden; margin-left: -5px; margin-right: -5px; }
4546

static/dist/css/sg_styles.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ a.tab_current:hover {background-color: #445; color: #fff; text-decoration: none;
134134
.clr:after {clear: both;content: '\0020';display: block;visibility: hidden;height: 0;}
135135

136136
/* nav */
137+
.navbar-default { position: static; }
137138
.navbar-default .navbar-nav>li>a { color: #bbbbbb; }
138139
.navbar-default .navbar-nav>.active>a { color: #ffffff; }
139140

@@ -142,7 +143,7 @@ a.tab_current:hover {background-color: #445; color: #fff; text-decoration: none;
142143
.navbar-header .navbar-brand { margin-top: -5px; }
143144
.navbar-header .navbar-brand img { width: 123px;height: 29px; }
144145

145-
.wrapper {margin-top: 52px;}
146+
/* .wrapper {margin-top: 52px;} */
146147

147148
.box_white { background: #FFF; clear: both; overflow: hidden; margin-left: -5px; margin-right: -5px; }
148149

static/dist/css/sg_styles.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/account.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/articles.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/books.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/dist/js/godl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)