mirror of
https://github.com/yuzu-emu/yuzu-emu.github.io.git
synced 2025-06-12 08:26:36 +00:00
Updated hugo and gulp dependencies.
This commit is contained in:
parent
730a095892
commit
4952831ce3
|
@ -8,9 +8,8 @@ cache: yarn
|
||||||
install:
|
install:
|
||||||
- echo '========== Installing gulp & dependencies =========='
|
- echo '========== Installing gulp & dependencies =========='
|
||||||
- sudo apt-get install graphicsmagick
|
- sudo apt-get install graphicsmagick
|
||||||
- wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.31.1/hugo_0.31.1_Linux-64bit.deb
|
- wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.52/hugo_0.52_Linux-64bit.deb
|
||||||
- sudo dpkg -i hugo.deb
|
- sudo dpkg -i hugo.deb
|
||||||
- yarn global add gulp
|
|
||||||
- yarn install
|
- yarn install
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
@ -18,7 +17,7 @@ before_script:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- echo '========== Starting gulp deploy task =========='
|
- echo '========== Starting gulp deploy task =========='
|
||||||
- gulp all --production
|
- yarn run gulp all --production
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: pages
|
provider: pages
|
||||||
|
|
89
gulpfile.js
89
gulpfile.js
|
@ -4,7 +4,6 @@ const exec = require('child_process').exec;
|
||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const util = require('gulp-util');
|
const util = require('gulp-util');
|
||||||
const merge = require('merge-stream');
|
const merge = require('merge-stream');
|
||||||
const runSequence = require('run-sequence');
|
|
||||||
const sass = require('gulp-sass');
|
const sass = require('gulp-sass');
|
||||||
const postcss = require('gulp-postcss');
|
const postcss = require('gulp-postcss');
|
||||||
const cssnano = require('cssnano');
|
const cssnano = require('cssnano');
|
||||||
|
@ -12,44 +11,7 @@ const concat = require('gulp-concat');
|
||||||
const imageResize = require('gulp-image-resize');
|
const imageResize = require('gulp-image-resize');
|
||||||
const browserSync = require('browser-sync').create();
|
const browserSync = require('browser-sync').create();
|
||||||
|
|
||||||
const baseUrl = 'https://yuzu-emu.org';
|
|
||||||
const cname = 'yuzu-emu.org';
|
|
||||||
let finalCommand = null;
|
|
||||||
|
|
||||||
// Gulp Run Tasks
|
// Gulp Run Tasks
|
||||||
gulp.task('default', ['start:setup'], callback => {
|
|
||||||
runSequence('hugo', finalCommand, callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('all', ['start:setup'], callback => {
|
|
||||||
runSequence(['scripts:compatdb', 'scripts:twitter', 'scripts:wiki'],
|
|
||||||
['assets:js', 'assets:scss'],
|
|
||||||
'hugo',
|
|
||||||
'assets:images',
|
|
||||||
finalCommand,
|
|
||||||
callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('assets', ['start:setup'], callback => {
|
|
||||||
runSequence(['assets:js', 'assets:scss'], 'hugo', 'assets:images', finalCommand, callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Gulp Pipeline
|
|
||||||
gulp.task('start:setup', () => {
|
|
||||||
if (util.env.production) {
|
|
||||||
process.env.HUGO_ENV = 'PRD';
|
|
||||||
process.env.HUGO_BASEURL = baseUrl;
|
|
||||||
finalCommand = 'final:publish';
|
|
||||||
} else {
|
|
||||||
process.env.HUGO_ENV = 'DEV';
|
|
||||||
process.env.HUGO_BASEURL = 'http://localhost:3000';
|
|
||||||
finalCommand = 'final:serve';
|
|
||||||
}
|
|
||||||
|
|
||||||
util.log(`process.env.HUGO_ENV = '${process.env.HUGO_ENV}'`);
|
|
||||||
util.log(`process.env.HUGO_BASEURL = '${process.env.HUGO_BASEURL}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('scripts:compatdb', callback => {
|
gulp.task('scripts:compatdb', callback => {
|
||||||
exec(`cd ./scripts/shared-hugo-scripts/compatdb/ && yarn install && node app.js`, (err, stdout, stderr) => {
|
exec(`cd ./scripts/shared-hugo-scripts/compatdb/ && yarn install && node app.js`, (err, stdout, stderr) => {
|
||||||
callback(err);
|
callback(err);
|
||||||
|
@ -85,7 +47,8 @@ gulp.task('assets:images', () => {
|
||||||
.pipe(gulp.dest('./'));
|
.pipe(gulp.dest('./'));
|
||||||
const screenshotImages = gulp.src(`build/images/screenshots/*`)
|
const screenshotImages = gulp.src(`build/images/screenshots/*`)
|
||||||
.pipe(imageResize({width: 640, height: 360, crop: false}))
|
.pipe(imageResize({width: 640, height: 360, crop: false}))
|
||||||
.pipe(gulp.dest(`build/images/screenshots/thumbs`));
|
.pipe(gulp.dest(`build/images/screenshots/thumbs`));
|
||||||
|
|
||||||
return merge(baseImages, jumbotronImages, bannerImages, boxartImages, iconImages, screenshotImages);
|
return merge(baseImages, jumbotronImages, bannerImages, boxartImages, iconImages, screenshotImages);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -104,19 +67,14 @@ gulp.task('assets:scss', () => {
|
||||||
.pipe(browserSync.stream());
|
.pipe(browserSync.stream());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('hugo', cb => {
|
gulp.task('hugo', callback => {
|
||||||
exec('hugo -s ./site/ -d ../build/ -v', (err, stdout, stderr) => {
|
exec('hugo -s ./site/ -d ../build/ -v', (err, stdout, stderr) => {
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
cb(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function fileChange(x) {
|
gulp.task('final:serve', (done) => {
|
||||||
console.log(`[FileChange] File changed: ${x.path}`);
|
|
||||||
browserSync.reload(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
gulp.task('final:serve', () => {
|
|
||||||
browserSync.init({
|
browserSync.init({
|
||||||
open: false,
|
open: false,
|
||||||
server: {
|
server: {
|
||||||
|
@ -124,15 +82,40 @@ gulp.task('final:serve', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.watch('src/js/**/*', ['assets:js']);
|
gulp.watch('src/js/**/*', gulp.series('assets:js'));
|
||||||
gulp.watch('src/scss/**/*', ['assets:scss']);
|
gulp.watch('src/scss/**/*', gulp.series('assets:scss'));
|
||||||
gulp.watch('site/**/*.html', ['hugo']);
|
gulp.watch('site/**/*.html', gulp.series('hugo'));
|
||||||
gulp.watch('site/**/*.md', ['hugo']);
|
gulp.watch('site/**/*.md', gulp.series('hugo'));
|
||||||
|
|
||||||
gulp.watch('build/**/*').on('change', fileChange);
|
gulp.watch('build/**/*').on('change', function() {
|
||||||
|
browserSync.reload(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
done()
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('final:publish', () => {
|
gulp.task('final:publish', (done) => {
|
||||||
fs.writeFileSync(`build/CNAME`, `${cname}`);
|
fs.writeFileSync(`build/CNAME`, `${cname}`);
|
||||||
fs.writeFileSync(`build/robots.txt`, `Sitemap: https://${cname}/sitemap.xml\n\nUser-agent: *`);
|
fs.writeFileSync(`build/robots.txt`, `Sitemap: https://${cname}/sitemap.xml\n\nUser-agent: *`);
|
||||||
|
done()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const cname = 'yuzu-emu.org';
|
||||||
|
let finalCommand = null;
|
||||||
|
|
||||||
|
if (util.env.production) {
|
||||||
|
process.env.HUGO_ENV = 'PRD';
|
||||||
|
process.env.HUGO_BASEURL = `https://${cname}`
|
||||||
|
finalCommand = 'final:publish';
|
||||||
|
} else {
|
||||||
|
process.env.HUGO_ENV = 'DEV';
|
||||||
|
process.env.HUGO_BASEURL = 'http://localhost:3000'
|
||||||
|
finalCommand = 'final:serve';
|
||||||
|
}
|
||||||
|
|
||||||
|
util.log(`process.env.HUGO_ENV = '${process.env.HUGO_ENV}'`)
|
||||||
|
util.log(`process.env.HUGO_BASEURL = '${process.env.HUGO_BASEURL}'`)
|
||||||
|
|
||||||
|
gulp.task('default', gulp.series(gulp.parallel('assets:js', 'assets:scss'), 'hugo', 'assets:images', finalCommand))
|
||||||
|
gulp.task('all', gulp.series(gulp.parallel('scripts:compatdb', 'scripts:twitter', 'scripts:wiki'), gulp.parallel('assets:js', 'assets:scss'), 'hugo', 'assets:images', finalCommand))
|
||||||
|
gulp.task('content', gulp.series('hugo', finalCommand))
|
||||||
|
|
9490
package-lock.json
generated
9490
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -19,14 +19,13 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bulma": "0.7.2",
|
"bulma": "0.7.2",
|
||||||
"cssnano": "^4.1.7",
|
"cssnano": "^4.1.7",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^4.0.0",
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-image-resize": "^0.13.0",
|
"gulp-image-resize": "^0.13.0",
|
||||||
"gulp-postcss": "^8.0.0",
|
"gulp-postcss": "^8.0.0",
|
||||||
"gulp-sass": "^4.0.2",
|
"gulp-sass": "^4.0.2",
|
||||||
"gulp-util": "^3.0.8",
|
"gulp-util": "^3.0.8",
|
||||||
"merge-stream": "^1.0.1",
|
"merge-stream": "^1.0.1"
|
||||||
"run-sequence": "^2.2.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browser-sync": "^2.23.5",
|
"browser-sync": "^2.23.5",
|
||||||
|
|
Loading…
Reference in a new issue