Skip to content

Commit

Permalink
Merge pull request #23 from HerringtonDarkholme/gh-pages
Browse files Browse the repository at this point in the history
修CDN回源错误
  • Loading branch information
HerringtonDarkholme committed Aug 26, 2015
2 parents 65dffc2 + b307687 commit 255124b
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 19 deletions.
10 changes: 5 additions & 5 deletions baicons.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

@font-face {
font-family: "baicons";
src: url('fonts/baicons.eot');
src: url('fonts/baicons.eot?#iefix') format('embedded-opentype'),
url('fonts/baicons.woff?ver=0.6.6') format('woff'),
url('fonts/baicons.ttf?ver=0.6.6') format('truetype'),
url('fonts/baicons.svg?ver=0.6.6#baicons') format('svg');
src: url('fonts/baicons-067.eot');
src: url('fonts/baicons-067.eot?#iefix') format('embedded-opentype'),
url('fonts/baicons-067.woff') format('woff'),
url('fonts/baicons-067.ttf') format('truetype'),
url('fonts/baicons-067.svg#baicons') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down
10 changes: 5 additions & 5 deletions baicons2.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

@font-face {
font-family: "baicons2";
src: url('fonts/baicons2.eot');
src: url('fonts/baicons2.eot?#iefix') format('embedded-opentype'),
url('fonts/baicons2.woff?ver=0.6.6') format('woff'),
url('fonts/baicons2.ttf?ver=0.6.6') format('truetype'),
url('fonts/baicons2.svg?ver=0.6.6#baicons2') format('svg');
src: url('fonts/baicons2-067.eot');
src: url('fonts/baicons2-067.eot?#iefix') format('embedded-opentype'),
url('fonts/baicons2-067.woff') format('woff'),
url('fonts/baicons2-067.ttf') format('truetype'),
url('fonts/baicons2-067.svg#baicons2') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down
Binary file renamed fonts/baicons.eot → fonts/baicons-067.eot
Binary file not shown.
File renamed without changes
Binary file renamed fonts/baicons.ttf → fonts/baicons-067.ttf
Binary file not shown.
Binary file renamed fonts/baicons.woff → fonts/baicons-067.woff
Binary file not shown.
Binary file removed fonts/baicons.woff2
Binary file not shown.
Binary file renamed fonts/baicons2.eot → fonts/baicons2-067.eot
Binary file not shown.
File renamed without changes
Binary file renamed fonts/baicons2.ttf → fonts/baicons2-067.ttf
Binary file not shown.
Binary file renamed fonts/baicons2.woff → fonts/baicons2-067.woff
Binary file not shown.
17 changes: 14 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ var gulp = require('gulp');
var iconfont = require('gulp-iconfont');
var consolidate = require('gulp-consolidate');
var rename = require('gulp-rename');
var clean = require('gulp-clean')

var p2bmapping = require('./template/p2b_mapping.json');
var version = require('./package.json').version
var version = require('./package.json').version.replace(/\./g, '')
var fontName = "baicons";
var fontName2 = "baicons2";

Expand All @@ -17,6 +18,10 @@ var p2b = "p2b.css";
var reference = "icons-reference.html";
var reference2 = "icons-reference2.html";

function cleanFonts(cb) {
gulp.src(fontPath).pipe(clean()).on('finish', cb)
}

function generateFonts(cb) {
gulp.src(['source/*.svg'])
.pipe(iconfont({
Expand Down Expand Up @@ -52,6 +57,9 @@ function generateFonts(cb) {
.pipe(rename(reference))
.pipe(gulp.dest(cssDest));
})
.pipe(rename(function(path) {
path.basename += '-' + version
}))
.pipe(gulp.dest('./fonts/'))
.on('finish',cb);
}
Expand Down Expand Up @@ -83,10 +91,13 @@ function generateFonts2(cb) {
.pipe(rename(reference2))
.pipe(gulp.dest(cssDest));
})
.pipe(rename(function(path) {
path.basename += '-' + version
}))
.pipe(gulp.dest('./fonts/'))
.on('finish',cb);
}

gulp.task('build', gulp.parallel(generateFonts, generateFonts2));
gulp.task('build', gulp.series(cleanFonts, generateFonts, generateFonts2));

gulp.task('default', gulp.parallel(generateFonts, generateFonts2));
gulp.task('default', gulp.series('build'));
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "baicons",
"version": "0.6.6",
"version": "0.6.7",
"repository": {
"type": "git",
"url": "https://github.com/baixing/baicons.git"
Expand All @@ -11,5 +11,8 @@
"gulp-iconfont": "^4.0.0",
"gulp-rename": "^1.2.0",
"lodash": "^3.0.1"
},
"dependencies": {
"gulp-clean": "^0.3.1"
}
}
10 changes: 5 additions & 5 deletions template/styles_template.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

@font-face {
font-family: "<%= fontName %>";
src: url('<%= fontPath %><%= fontName %>.eot');
src: url('<%= fontPath %><%= fontName %>.eot?#iefix') format('embedded-opentype'),
url('<%= fontPath %><%= fontName %>.woff?ver=<%= version %>') format('woff'),
url('<%= fontPath %><%= fontName %>.ttf?ver=<%= version %>') format('truetype'),
url('<%= fontPath %><%= fontName %>.svg?ver=<%= version %>#<%= fontName %>') format('svg');
src: url('<%= fontPath %><%= fontName %>-<%= version %>.eot');
src: url('<%= fontPath %><%= fontName %>-<%= version %>.eot?#iefix') format('embedded-opentype'),
url('<%= fontPath %><%= fontName %>-<%= version %>.woff') format('woff'),
url('<%= fontPath %><%= fontName %>-<%= version %>.ttf') format('truetype'),
url('<%= fontPath %><%= fontName %>-<%= version %>.svg#<%= fontName %>') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down

0 comments on commit 255124b

Please sign in to comment.