Cleaned up gulp file. Using gulp-image-resize for image cropping with gravity.
This commit is contained in:
parent
be79e86d07
commit
d08ed863e0
|
@ -29,6 +29,7 @@ before_script:
|
||||||
- cd $TRAVIS_BUILD_DIR
|
- cd $TRAVIS_BUILD_DIR
|
||||||
|
|
||||||
- echo '========== Installing gulp / hugo dependencies =========='
|
- echo '========== Installing gulp / hugo dependencies =========='
|
||||||
|
- convert -help
|
||||||
- yarn global add @alrra/travis-scripts
|
- yarn global add @alrra/travis-scripts
|
||||||
- yarn global add gulp
|
- yarn global add gulp
|
||||||
- yarn global add hugo-bin
|
- yarn global add hugo-bin
|
||||||
|
|
34
gulpfile.js
34
gulpfile.js
|
@ -1,22 +1,18 @@
|
||||||
var gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
var gutil = require('gulp-util');
|
const exec = require('child_process').exec;
|
||||||
var exec = require('child_process').exec;
|
const rimraf = require('rimraf');
|
||||||
var rimraf = require('rimraf');
|
|
||||||
|
|
||||||
var postcss = require('gulp-postcss');
|
const ghPages = require('gulp-gh-pages');
|
||||||
var cssImport = require('postcss-import');
|
|
||||||
var cssnext = require('postcss-cssnext');
|
|
||||||
|
|
||||||
var md5 = require("gulp-md5-plus");
|
const md5 = require("gulp-md5-plus");
|
||||||
|
const postcss = require('gulp-postcss');
|
||||||
|
const cssImport = require('postcss-import');
|
||||||
|
const cssnext = require('postcss-cssnext');
|
||||||
|
const cleanCSS = require('gulp-clean-css');
|
||||||
|
|
||||||
var ghPages = require('gulp-gh-pages');
|
const imageResize = require('gulp-image-resize');
|
||||||
|
|
||||||
var uncss = require('gulp-uncss');
|
const htmlmin = require('gulp-htmlmin');
|
||||||
var cleanCSS = require('gulp-clean-css');
|
|
||||||
var image = require('gulp-image');
|
|
||||||
var jimp = require("gulp-jimp-resize");
|
|
||||||
|
|
||||||
var htmlmin = require('gulp-htmlmin');
|
|
||||||
|
|
||||||
const distPath = './site/public';
|
const distPath = './site/public';
|
||||||
const cname = 'citra-emu.org';
|
const cname = 'citra-emu.org';
|
||||||
|
@ -53,16 +49,16 @@ gulp.task('images', ['hugo'], () => (
|
||||||
gulp.src(`${distPath}/images/*`, {base: './'})
|
gulp.src(`${distPath}/images/*`, {base: './'})
|
||||||
.pipe(gulp.dest('./')),
|
.pipe(gulp.dest('./')),
|
||||||
gulp.src(`${distPath}/images/jumbotron/*`, {base: './'})
|
gulp.src(`${distPath}/images/jumbotron/*`, {base: './'})
|
||||||
.pipe(jimp({ sizes: [{"width": 786, "height": 471 }] }))
|
.pipe(imageResize({ width: 786, height: 471, crop: true }))
|
||||||
.pipe(gulp.dest('./')),
|
.pipe(gulp.dest('./')),
|
||||||
gulp.src(`${distPath}/images/banners/*`, {base: './'})
|
gulp.src(`${distPath}/images/banners/*`, {base: './'})
|
||||||
.pipe(jimp({ sizes: [{"width": 824, "height": 306 }] }))
|
.pipe(imageResize({ width: 824, height: 306, crop: false }))
|
||||||
.pipe(gulp.dest('./')),
|
.pipe(gulp.dest('./')),
|
||||||
gulp.src(`${distPath}/images/game/boxart/*`, {base: './'})
|
gulp.src(`${distPath}/images/game/boxart/*`, {base: './'})
|
||||||
.pipe(jimp({ sizes: [{"width": 328, "height": 300 }] }))
|
.pipe(imageResize({ width: 328, height: 300, crop: true }))
|
||||||
.pipe(gulp.dest('./')),
|
.pipe(gulp.dest('./')),
|
||||||
gulp.src(`${distPath}/images/game/icons/*`, {base: './'})
|
gulp.src(`${distPath}/images/game/icons/*`, {base: './'})
|
||||||
.pipe(jimp({ sizes: [{"width": 48, "height": 48 }] }))
|
.pipe(imageResize({ width: 48, height: 48, crop: true }))
|
||||||
.pipe(gulp.dest('./'))
|
.pipe(gulp.dest('./'))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,8 @@
|
||||||
"gulp-clean-css": "^3.0.3",
|
"gulp-clean-css": "^3.0.3",
|
||||||
"gulp-gh-pages": "^0.5.4",
|
"gulp-gh-pages": "^0.5.4",
|
||||||
"gulp-htmlmin": "^3.0.0",
|
"gulp-htmlmin": "^3.0.0",
|
||||||
"gulp-image": "^2.7.5",
|
"gulp-image-resize": "^0.12.0",
|
||||||
"gulp-jimp-resize": "^2.0.2",
|
|
||||||
"gulp-md5-plus": "^0.2.5",
|
"gulp-md5-plus": "^0.2.5",
|
||||||
"gulp-postcss": "^6.3.0",
|
|
||||||
"gulp-uncss": "^1.0.6",
|
|
||||||
"gulp-util": "^3.0.8",
|
|
||||||
"postcss-cssnext": "^2.9.0",
|
"postcss-cssnext": "^2.9.0",
|
||||||
"postcss-import": "^8.2.0",
|
"postcss-import": "^8.2.0",
|
||||||
"rimraf": "^2.6.1"
|
"rimraf": "^2.6.1"
|
||||||
|
|
|
@ -26,9 +26,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<div class="row" style="padding-bottom: 16px;">
|
<div class="row">
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<img class="center-block img-responsive compatibility-boxart" style="padding-top: 6px;" src="{{ .Site.BaseURL }}images/game/boxart/{{ .Params.Banner | default (print .File.BaseFileName ".png") }}" />
|
<div class="boxart">
|
||||||
|
<img src="{{ .Site.BaseURL }}images/game/boxart/{{ .Params.Banner | default (print .File.BaseFileName ".png") }}" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-7">
|
<div class="col-md-7">
|
||||||
<!-- Metadata information -->
|
<!-- Metadata information -->
|
||||||
|
@ -36,7 +38,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
{{- $rating := index .Site.Data.compatibility .Params.compatibility }}
|
{{- $rating := index .Site.Data.compatibility .Params.compatibility }}
|
||||||
<td style="width: 120px;">Status</td>
|
<td style="width: 120px;">Rating</td>
|
||||||
<td><b><div class="square-icon" style="background-color: {{ $rating.color }}"></div> {{ $rating.name }}</b><br />{{ $rating.description }}</td>
|
<td><b><div class="square-icon" style="background-color: {{ $rating.color }}"></div> {{ $rating.name }}</b><br />{{ $rating.description }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -81,6 +83,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Tested By</th>
|
<th>Tested By</th>
|
||||||
|
<th>Hardware</th>
|
||||||
<th>Citra Version</th>
|
<th>Citra Version</th>
|
||||||
<th>Rating</th>
|
<th>Rating</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -89,6 +92,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ dateFormat "January 2, 2006" .date }}</td>
|
<td>{{ dateFormat "January 2, 2006" .date }}</td>
|
||||||
<td><a href="https://community.citra-emu.org/u/{{ .author }}/summary">{{ .author }}</a></td>
|
<td><a href="https://community.citra-emu.org/u/{{ .author }}/summary">{{ .author }}</a></td>
|
||||||
|
<td>{{ .cpu }}<br />{{ .gpu }}<br />{{ .os }}</td>
|
||||||
<td>{{ .version }}</td>
|
<td>{{ .version }}</td>
|
||||||
<td><b><div class="square-icon" style="background-color: {{ $rating.color }}"></div> {{ $rating.name }}</b></td>
|
<td><b><div class="square-icon" style="background-color: {{ $rating.color }}"></div> {{ $rating.name }}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -323,4 +323,3 @@ a:hover, a:focus {
|
||||||
|
|
||||||
/* Games Module */
|
/* Games Module */
|
||||||
.game-icon-list { }
|
.game-icon-list { }
|
||||||
.compatibility-boxart { width: 328px; height: 300px; padding-bottom: 16px; }
|
|
||||||
|
|
Reference in New Issue