mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-11 23:55:16 +01:00
use nice cdn url
This commit is contained in:
parent
9abb413924
commit
e7baca7c8f
11
gulpfile.js
11
gulpfile.js
@ -38,7 +38,7 @@ console.log("");
|
|||||||
// paths
|
// paths
|
||||||
var src = '_src',
|
var src = '_src',
|
||||||
dist = '_site',
|
dist = '_site',
|
||||||
cdn = 'https://d2jlreog722xe2.cloudfront.net',
|
cdn = 'https://cdn.kremalicious.com',
|
||||||
s3bucket = 'kremalicious.com',
|
s3bucket = 'kremalicious.com',
|
||||||
s3path = '/',
|
s3path = '/',
|
||||||
s3region = 'eu-central-1';
|
s3region = 'eu-central-1';
|
||||||
@ -325,7 +325,10 @@ gulp.task('revision:replace', function() {
|
|||||||
// CDN url injection
|
// CDN url injection
|
||||||
//
|
//
|
||||||
gulp.task('cdn', function() {
|
gulp.task('cdn', function() {
|
||||||
return gulp.src([dist + '/**/*.html', dist + '/assets/css/*.css'], { base: dist })
|
return gulp.src([
|
||||||
|
dist + '/**/*.html',
|
||||||
|
dist + '/assets/css/*.css'
|
||||||
|
], { base: dist })
|
||||||
.pipe($.replace('/assets/css/', cdn + '/assets/css/'))
|
.pipe($.replace('/assets/css/', cdn + '/assets/css/'))
|
||||||
.pipe($.replace('/assets/js/', cdn + '/assets/js/'))
|
.pipe($.replace('/assets/js/', cdn + '/assets/js/'))
|
||||||
//.pipe($.replace('/assets/img/', cdn + '/assets/img/'))
|
//.pipe($.replace('/assets/img/', cdn + '/assets/img/'))
|
||||||
@ -339,7 +342,7 @@ gulp.task('cdn', function() {
|
|||||||
//
|
//
|
||||||
// Assets uploading to S3
|
// Assets uploading to S3
|
||||||
//
|
//
|
||||||
gulp.task('s3', function() {
|
gulp.task('s3:assets', function() {
|
||||||
var publisher = $.awspublish.create({
|
var publisher = $.awspublish.create({
|
||||||
params: {
|
params: {
|
||||||
'Bucket': s3bucket
|
'Bucket': s3bucket
|
||||||
@ -434,7 +437,7 @@ gulp.task('build', function(cb) {
|
|||||||
'revision:replace',
|
'revision:replace',
|
||||||
'cdn',
|
'cdn',
|
||||||
['optimize:html', 'optimize:images', 'optimize:css', 'optimize:js'],
|
['optimize:html', 'optimize:images', 'optimize:css', 'optimize:js'],
|
||||||
's3',
|
's3:assets',
|
||||||
cb
|
cb
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user