Authored by 陈轩

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

... ... @@ -13,14 +13,16 @@ const ftp = require('gulp-ftp');
const postcss = require('gulp-postcss');
const sourcemaps = require('gulp-sourcemaps');
const cssnano = require('gulp-cssnano');
const scss = require('postcss-scss');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const webpackConfig = require('./webpack.config.js');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const Dashboard = require('webpack-dashboard');
const DashboardPlugin = require('webpack-dashboard/plugin');
const webpackConfig = require('./webpack.config.js');
const env = {
dev: Symbol('development'),
pro: Symbol('production')
... ... @@ -48,7 +50,7 @@ const dist = {
const postcssPlugin = (et) => {
let sprites = {
spritesmith: {
padding: 2
padding: 8
},
filterBy(file) {
// base64 的图片没有 url 过滤掉
... ... @@ -60,7 +62,7 @@ const postcssPlugin = (et) => {
groupBy(file) {
let group = file.url.split('/')[1];
group = group === '' ? 'yo' : group;
group = group === '' ? 'yoho' : group;
file.retina = true;
... ... @@ -193,12 +195,12 @@ gulp.task('webpack-dev-server', () => {
postcss: {
plugins: postcssPlugin(env.dev),
options: {
parser: require('postcss-scss')
parser: scss
}
},
autoprefixer: false,
loaders: {
css: ExtractTextPlugin.extract(['css?-url'])
css: ExtractTextPlugin.extract(['css?-url&sourceMap'])
}
}
});
... ... @@ -243,7 +245,7 @@ gulp.task('webpack', ['assets'], (done) => {
postcss: {
plugins: postcssPlugin(env.pro),
options: {
parser: require('postcss-scss')
parser: scss
}
},
autoprefixer: false,
... ... @@ -255,13 +257,12 @@ gulp.task('webpack', ['assets'], (done) => {
proConfig.output.path = dist.js;
// TODO: 生产环境加载的插件独立出来
// 生产环境插件
proConfig.plugins.push(new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}));
proConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
}), new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
... ...
... ... @@ -40,7 +40,7 @@
<img :src="item.thumb | resize 213 134"/>
</a>
</div>
<h3><a :href="`/editorial/${item.id}.html`">{{item.title}}</a></h3>
<h3><a class="line-clamp-2" :href="`/editorial/${item.id}.html`">{{item.title}}</a></h3>
<div class="sub-time">
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span>
</div>
... ...
... ... @@ -7,7 +7,9 @@
<img v-lazy="editorial.src | resize 750 469" alt="" />
</a>
</div>
<div class="title"><a class="line-clamp-2" href='{{"/editorial/" + editorial.id + ".html"}}'>{{editorial.title}}</a></div>
<div class="title">
<a class="line-clamp-2" href='{{"/editorial/" + editorial.id + ".html"}}'>{{editorial.title}}</a>
</div>
<div class="editorial-des">
<p class="line-clamp-2">{{editorial.intro}}</p>
</div>
... ... @@ -43,6 +45,10 @@
line-height: 43px;
font-weight: 700;
padding: 30px;
a {
height: 86px;
}
}
.editorial-des {
... ...
... ... @@ -13,6 +13,10 @@
.blk-header {
transition: 0.3s all;
}
.ghost .blk-header {
color: #fff;
}
</style>
<script>
... ... @@ -84,7 +88,7 @@
if (topHeight > 100) {
topChange = false;
}
}
this.$refs.header.$el.classList.toggle('ghost', topChange);
}
... ...