minify plugin

This commit is contained in:
bchiang7
2016-12-09 21:17:44 -05:00
parent 380a86c6dc
commit f33979af1c
10 changed files with 1972 additions and 43 deletions

View File

@@ -3,6 +3,7 @@ exclude:
- "Gemfile.lock"
- "README.md"
- "*.gemspec"
- "node_modules"
keep_files:
- "CNAME"
@@ -35,3 +36,6 @@ social:
# Build settings
markdown: kramdown
gems:
- jekyll-minifier

View File

@@ -1,10 +1,8 @@
<meta charset="UTF-8"><!--[if IE]><![endif]-->
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>{{ site.title }}</title>
<link rel="shortcut icon" href="{{site.logo}}" hreflang="en-us">
<meta property="og:title" content="{{site.title}}" />
<meta property="og:description" content="{{site.description}}" />
<meta property="og:type" content="website" />
@@ -15,15 +13,12 @@
<meta property="og:image:height" content="800" />
<meta property="og:image:type" content="image/jpg" />
<meta property="og:locale" content="en_US">
<meta name="description" content="{{site.description}}">
<meta name="keywords" content="design, development, web, bchiang7, brittany, chiang, javascript, northeastern">
<meta name="google-site-verification" content="DCl7VAf9tcz6eD9gb67NfkNnJ1PKRNcg8qQiwpbx9Lk" />
<meta itemprop="name" content="{{site.title}}">
<meta itemprop="description" content="{{site.description}}">
<meta itemprop="image" content="{{site.cover}}">
<meta name="twitter:card" content="summary">
<meta name="twitter:url" content="{{site.url}}">
<meta name="twitter:site" content="@bchiang7">
@@ -33,5 +28,3 @@
<meta name="twitter:image:src" content="{{site.cover}}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css" hreflang="en-us">

View File

@@ -10,13 +10,11 @@
{% endfor %}
</ul>
</nav>
<div id="toggle" class="container">
<span class="line top"></span>
<span class="line middle"></span>
<span class="line bottom"></span>
</div>
<div id="overlay" class="overlay">
<div class="logo"><img class="logo-img" src="img/logo-white.png" alt=""><span>Brittany Chiang</span></div>
<nav class="overlay-menu">

View File

@@ -5,9 +5,9 @@
</head>
<body>
{% include nav.html %}
<div id="skrollr-body">
<!-- <div id="skrollr-body"> -->
{{ content }}
</div>
<!-- </div> -->
{% include scripts.html %}
</body>
</html>

View File

@@ -35,7 +35,7 @@
height: 20px;
width: 20px;
border-radius: 50%;
background-color: rgba(255,255,255,0.25);
background: rgba(255,255,255,0.25);
transition: transform 0.2s, background-color 0.5s;
transform-origin: 50% 50%;
}

View File

@@ -220,6 +220,7 @@
display: block;
width: 90%;
font-family: $Gotham, $sans-serif-stack;
margin-top: 30px;
margin-bottom: 100px;
@include MQ(M) {
margin-bottom: 70px;

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +1,10 @@
var gulp = require('gulp');
var browserSync = require('browser-sync');
var cp = require('child_process');
var htmlmin = require('gulp-htmlmin');
var sass = require('gulp-sass');
var cssnano = require('gulp-cssnano');
var cleanCSS = require('gulp-clean-css');
var prefix = require('gulp-autoprefixer');
var jshint = require('gulp-jshint');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var jekyll = process.platform === 'win32' ? 'jekyll.bat' : 'jekyll';
@@ -38,22 +34,14 @@ gulp.task('browser-sync', ['styles', 'scripts', 'jekyll-dev'], function() {
});
});
gulp.task('htmlmin', function() {
return gulp.src('*.html')
.pipe(htmlmin({collapseWhitespace: true, removeComments: true}))
.pipe(gulp.dest('_site'));
});
// Compile files from _scss into both _site/css (for live injecting) and site (for future jekyll builds)
gulp.task('styles', function() {
return gulp.src('_scss/*.scss')
.pipe(sass({
includePaths: ['scss'],
onError: browserSync.notify
})
)
}))
.pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {cascade: true}))
.pipe(cssnano())
.pipe(gulp.dest('_site/css'))
.pipe(browserSync.reload({stream:true}))
.pipe(gulp.dest('css'));
@@ -78,6 +66,8 @@ gulp.task('watch', function () {
gulp.watch(['index.html', '404.html', '_layouts/*.html', '_posts/*', '_includes/*.html', '_drafts/*', '**/*.html'], ['jekyll-rebuild']);
});
// ============================= PROD ============================== //
// Build the Jekyll Site in production mode
gulp.task('jekyll-prod', function (done) {
browserSync.notify(messages.jekyllProd);
@@ -85,23 +75,19 @@ gulp.task('jekyll-prod', function (done) {
.on('close', done);
});
// Identical Sass compilation task to development mode, with an additional minification step thrown in using clean-css
gulp.task('styles-prod', function () {
return gulp.src('_scss/*.scss')
.pipe(sass({
includePaths: ['scss'],
onError: browserSync.notify
}))
.pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))
.pipe(cssnano())
.pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {cascade: true}))
.pipe(gulp.dest('_site/css'))
.pipe(gulp.dest('css'));
});
// Identical Javascript compilation task to development mode, with an additional minification step thrown in using uglify
gulp.task('scripts-prod', function() {
return gulp.src(['js/*.js'])
.pipe(uglify())
.pipe(gulp.dest('_site/js'));
});
@@ -120,4 +106,4 @@ gulp.task('fonts', function() {
gulp.task('default', ['browser-sync', 'watch']);
// Build task, run using gulp build to compile Sass and Javascript ready for deployment.
gulp.task('build', ['fonts', 'images', 'styles-prod', 'scripts-prod', 'jekyll-prod']);
gulp.task('build', ['styles-prod', 'scripts-prod', 'images', 'fonts', 'jekyll-prod']);

View File

@@ -1,13 +1,14 @@
---
layout: default
---
{% include intro.html %}
{% include about.html %}
{% include services.html %}
{% include skills.html %}
{% include experience.html %}
{% include resume_btn.html %}
{% include portfolio.html %}
{% include contact.html %}
{% include footer.html %}
<div id="skrollr-body">
{% include intro.html %}
{% include about.html %}
{% include services.html %}
{% include skills.html %}
{% include experience.html %}
{% include resume_btn.html %}
{% include portfolio.html %}
{% include contact.html %}
{% include footer.html %}
</div>

View File

@@ -1,5 +1,4 @@
$(function() {
// ==================== VERTICAL NAV ==================== //
var contentSections = $('.section'),
navigationItems = $('#dot-nav a'),
overlayItems = $('#overlay a');