Authored by 陈轩

Merge remote-tracking branch 'origin/develop' into develop

@@ -13,14 +13,16 @@ const ftp = require('gulp-ftp'); @@ -13,14 +13,16 @@ const ftp = require('gulp-ftp');
13 const postcss = require('gulp-postcss'); 13 const postcss = require('gulp-postcss');
14 const sourcemaps = require('gulp-sourcemaps'); 14 const sourcemaps = require('gulp-sourcemaps');
15 const cssnano = require('gulp-cssnano'); 15 const cssnano = require('gulp-cssnano');
  16 +const scss = require('postcss-scss');
16 17
17 const webpack = require('webpack'); 18 const webpack = require('webpack');
18 const WebpackDevServer = require('webpack-dev-server'); 19 const WebpackDevServer = require('webpack-dev-server');
19 -const webpackConfig = require('./webpack.config.js');  
20 const ExtractTextPlugin = require('extract-text-webpack-plugin'); 20 const ExtractTextPlugin = require('extract-text-webpack-plugin');
21 const Dashboard = require('webpack-dashboard'); 21 const Dashboard = require('webpack-dashboard');
22 const DashboardPlugin = require('webpack-dashboard/plugin'); 22 const DashboardPlugin = require('webpack-dashboard/plugin');
23 23
  24 +const webpackConfig = require('./webpack.config.js');
  25 +
24 const env = { 26 const env = {
25 dev: Symbol('development'), 27 dev: Symbol('development'),
26 pro: Symbol('production') 28 pro: Symbol('production')
@@ -48,7 +50,7 @@ const dist = { @@ -48,7 +50,7 @@ const dist = {
48 const postcssPlugin = (et) => { 50 const postcssPlugin = (et) => {
49 let sprites = { 51 let sprites = {
50 spritesmith: { 52 spritesmith: {
51 - padding: 2 53 + padding: 8
52 }, 54 },
53 filterBy(file) { 55 filterBy(file) {
54 // base64 的图片没有 url 过滤掉 56 // base64 的图片没有 url 过滤掉
@@ -60,7 +62,7 @@ const postcssPlugin = (et) => { @@ -60,7 +62,7 @@ const postcssPlugin = (et) => {
60 groupBy(file) { 62 groupBy(file) {
61 let group = file.url.split('/')[1]; 63 let group = file.url.split('/')[1];
62 64
63 - group = group === '' ? 'yo' : group; 65 + group = group === '' ? 'yoho' : group;
64 66
65 file.retina = true; 67 file.retina = true;
66 68
@@ -193,12 +195,12 @@ gulp.task('webpack-dev-server', () => { @@ -193,12 +195,12 @@ gulp.task('webpack-dev-server', () => {
193 postcss: { 195 postcss: {
194 plugins: postcssPlugin(env.dev), 196 plugins: postcssPlugin(env.dev),
195 options: { 197 options: {
196 - parser: require('postcss-scss') 198 + parser: scss
197 } 199 }
198 }, 200 },
199 autoprefixer: false, 201 autoprefixer: false,
200 loaders: { 202 loaders: {
201 - css: ExtractTextPlugin.extract(['css?-url']) 203 + css: ExtractTextPlugin.extract(['css?-url&sourceMap'])
202 } 204 }
203 } 205 }
204 }); 206 });
@@ -243,7 +245,7 @@ gulp.task('webpack', ['assets'], (done) => { @@ -243,7 +245,7 @@ gulp.task('webpack', ['assets'], (done) => {
243 postcss: { 245 postcss: {
244 plugins: postcssPlugin(env.pro), 246 plugins: postcssPlugin(env.pro),
245 options: { 247 options: {
246 - parser: require('postcss-scss') 248 + parser: scss
247 } 249 }
248 }, 250 },
249 autoprefixer: false, 251 autoprefixer: false,
@@ -255,13 +257,12 @@ gulp.task('webpack', ['assets'], (done) => { @@ -255,13 +257,12 @@ gulp.task('webpack', ['assets'], (done) => {
255 257
256 proConfig.output.path = dist.js; 258 proConfig.output.path = dist.js;
257 259
258 - // TODO: 生产环境加载的插件独立出来 260 + // 生产环境插件
259 proConfig.plugins.push(new webpack.DefinePlugin({ 261 proConfig.plugins.push(new webpack.DefinePlugin({
260 'process.env': { 262 'process.env': {
261 NODE_ENV: '"production"' 263 NODE_ENV: '"production"'
262 } 264 }
263 - }));  
264 - proConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({ 265 + }), new webpack.optimize.UglifyJsPlugin({
265 compress: { 266 compress: {
266 warnings: false 267 warnings: false
267 } 268 }
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 <img :src="item.thumb | resize 213 134"/> 40 <img :src="item.thumb | resize 213 134"/>
41 </a> 41 </a>
42 </div> 42 </div>
43 - <h3><a :href="`/editorial/${item.id}.html`">{{item.title}}</a></h3> 43 + <h3><a class="line-clamp-2" :href="`/editorial/${item.id}.html`">{{item.title}}</a></h3>
44 <div class="sub-time"> 44 <div class="sub-time">
45 <span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span> 45 <span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span>
46 </div> 46 </div>
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 <img v-lazy="editorial.src | resize 750 469" alt="" /> 7 <img v-lazy="editorial.src | resize 750 469" alt="" />
8 </a> 8 </a>
9 </div> 9 </div>
10 - <div class="title"><a class="line-clamp-2" href='{{"/editorial/" + editorial.id + ".html"}}'>{{editorial.title}}</a></div> 10 + <div class="title">
  11 + <a class="line-clamp-2" href='{{"/editorial/" + editorial.id + ".html"}}'>{{editorial.title}}</a>
  12 + </div>
11 <div class="editorial-des"> 13 <div class="editorial-des">
12 <p class="line-clamp-2">{{editorial.intro}}</p> 14 <p class="line-clamp-2">{{editorial.intro}}</p>
13 </div> 15 </div>
@@ -43,6 +45,10 @@ @@ -43,6 +45,10 @@
43 line-height: 43px; 45 line-height: 43px;
44 font-weight: 700; 46 font-weight: 700;
45 padding: 30px; 47 padding: 30px;
  48 +
  49 + a {
  50 + height: 86px;
  51 + }
46 } 52 }
47 53
48 .editorial-des { 54 .editorial-des {
@@ -13,6 +13,10 @@ @@ -13,6 +13,10 @@
13 .blk-header { 13 .blk-header {
14 transition: 0.3s all; 14 transition: 0.3s all;
15 } 15 }
  16 +
  17 + .ghost .blk-header {
  18 + color: #fff;
  19 + }
16 </style> 20 </style>
17 21
18 <script> 22 <script>
@@ -84,7 +88,7 @@ @@ -84,7 +88,7 @@
84 88
85 if (topHeight > 100) { 89 if (topHeight > 100) {
86 topChange = false; 90 topChange = false;
87 - } 91 + }
88 92
89 this.$refs.header.$el.classList.toggle('ghost', topChange); 93 this.$refs.header.$el.classList.toggle('ghost', topChange);
90 } 94 }