From d08ed863e04ea89e895582f7e068b06ff9fa0d74 Mon Sep 17 00:00:00 2001 From: chris062689 Date: Sat, 10 Jun 2017 16:35:01 -0400 Subject: [PATCH] Cleaned up gulp file. Using gulp-image-resize for image cropping with gravity. --- .travis.yml | 1 + gulpfile.js | 34 ++++++++----------- package.json | 6 +--- .../citra-bs-theme/layouts/game/single.html | 10 ++++-- .../citra-bs-theme/static/css/style.css | 1 - 5 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9bf62a7..186265c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ before_script: - cd $TRAVIS_BUILD_DIR - echo '========== Installing gulp / hugo dependencies ==========' + - convert -help - yarn global add @alrra/travis-scripts - yarn global add gulp - yarn global add hugo-bin diff --git a/gulpfile.js b/gulpfile.js index 790f2ae..bbc1d15 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,22 +1,18 @@ -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var exec = require('child_process').exec; -var rimraf = require('rimraf'); +const gulp = require('gulp'); +const exec = require('child_process').exec; +const rimraf = require('rimraf'); -var postcss = require('gulp-postcss'); -var cssImport = require('postcss-import'); -var cssnext = require('postcss-cssnext'); +const ghPages = require('gulp-gh-pages'); -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'); -var cleanCSS = require('gulp-clean-css'); -var image = require('gulp-image'); -var jimp = require("gulp-jimp-resize"); - -var htmlmin = require('gulp-htmlmin'); +const htmlmin = require('gulp-htmlmin'); const distPath = './site/public'; const cname = 'citra-emu.org'; @@ -53,16 +49,16 @@ gulp.task('images', ['hugo'], () => ( gulp.src(`${distPath}/images/*`, {base: './'}) .pipe(gulp.dest('./')), gulp.src(`${distPath}/images/jumbotron/*`, {base: './'}) - .pipe(jimp({ sizes: [{"width": 786, "height": 471 }] })) + .pipe(imageResize({ width: 786, height: 471, crop: true })) .pipe(gulp.dest('./')), gulp.src(`${distPath}/images/banners/*`, {base: './'}) - .pipe(jimp({ sizes: [{"width": 824, "height": 306 }] })) + .pipe(imageResize({ width: 824, height: 306, crop: false })) .pipe(gulp.dest('./')), 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('./')), 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('./')) )); diff --git a/package.json b/package.json index acaf5de..9481bab 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,8 @@ "gulp-clean-css": "^3.0.3", "gulp-gh-pages": "^0.5.4", "gulp-htmlmin": "^3.0.0", - "gulp-image": "^2.7.5", - "gulp-jimp-resize": "^2.0.2", + "gulp-image-resize": "^0.12.0", "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-import": "^8.2.0", "rimraf": "^2.6.1" diff --git a/site/themes/citra-bs-theme/layouts/game/single.html b/site/themes/citra-bs-theme/layouts/game/single.html index a2aeddc..2fafcfa 100644 --- a/site/themes/citra-bs-theme/layouts/game/single.html +++ b/site/themes/citra-bs-theme/layouts/game/single.html @@ -26,9 +26,11 @@

{{ .Title }}

-
+
- +
+ +
@@ -36,7 +38,7 @@ {{- $rating := index .Site.Data.compatibility .Params.compatibility }} - Status + Rating
{{ $rating.name }}

{{ $rating.description }} @@ -81,6 +83,7 @@ Date Tested By + Hardware Citra Version Rating @@ -89,6 +92,7 @@ {{ dateFormat "January 2, 2006" .date }} {{ .author }} + {{ .cpu }}
{{ .gpu }}
{{ .os }} {{ .version }}
{{ $rating.name }}
diff --git a/site/themes/citra-bs-theme/static/css/style.css b/site/themes/citra-bs-theme/static/css/style.css index 4422391..8a151d0 100644 --- a/site/themes/citra-bs-theme/static/css/style.css +++ b/site/themes/citra-bs-theme/static/css/style.css @@ -323,4 +323,3 @@ a:hover, a:focus { /* Games Module */ .game-icon-list { } -.compatibility-boxart { width: 328px; height: 300px; padding-bottom: 16px; }