Skip to content

Commit

Permalink
Update link wiki and add gulp favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
brenopolanski committed Aug 18, 2017
1 parent 8dd7449 commit 5e63b59
Show file tree
Hide file tree
Showing 22 changed files with 641 additions and 279 deletions.
8 changes: 4 additions & 4 deletions gulp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

'use strict';

var gulp = require('gulp');
var fs = require('fs');
var path = require('path');
var tasks = fs.readdirSync('./gulp/tasks');
const gulp = require('gulp');
const fs = require('fs');
const path = require('path');
const tasks = fs.readdirSync('./gulp/tasks');

tasks.forEach((task) => {
require(path.join(__dirname, 'tasks', task));
Expand Down
3 changes: 2 additions & 1 deletion gulp/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ module.exports = {
js: './src/js/**/*.js',
styl: './src/styl/**/*.styl',
img: './src/images/**/*',
favicon: './src/images/favicon.png',
files: {
copy: ['./src/humans.txt', './src/favicon.ico'],
copy: ['./src/humans.txt'],
jade: './src/templates/index.jade',
styl: './src/styl/main.styl'
}
Expand Down
6 changes: 3 additions & 3 deletions gulp/tasks/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var paths = require('../paths');
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const paths = require('../paths');

// Call Font Awesome
gulp.task('fontAwesome', () => {
Expand Down
8 changes: 4 additions & 4 deletions gulp/tasks/browser-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var browserSync = require('browser-sync');
var paths = require('../paths');
const gulp = require('gulp');
const browserSync = require('browser-sync');
const paths = require('../paths');

// Serve files from /www/
module.exports = gulp.task('browser-sync', () => {
var files = [
const files = [
paths.browserSync.html,
paths.browserSync.js,
paths.browserSync.css,
Expand Down
6 changes: 3 additions & 3 deletions gulp/tasks/copy-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var paths = require('../paths');
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const paths = require('../paths');

// Call Copy files
module.exports = gulp.task('copy-files', () => {
Expand Down
4 changes: 2 additions & 2 deletions gulp/tasks/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
const gulp = require('gulp');

// Default task
module.exports = gulp.task('default', ['js', 'jade', 'stylus', 'imagemin',
'copy-files', 'assets-install', 'watch', 'browser-sync']);
'copy-files', 'assets-install', 'favicon-install', 'watch', 'browser-sync']);
123 changes: 123 additions & 0 deletions gulp/tasks/favicon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/**
* Copyright 2016 OSBI Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// Necessary Plugins
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const realFavicon = require ('gulp-real-favicon');
const fs = require('fs');
const paths = require('../paths');

// Source: http://realfavicongenerator.net/

// File where the favicon markups are stored
const FAVICON_DATA_FILE = `${paths.build.img}/faviconData.json`;

// Generate the icons. This task takes a few seconds to complete.
// You should run it at least once to create the icons. Then,
// you should run it whenever RealFaviconGenerator updates its
// package (see the check-for-favicon-update task below).
gulp.task('generate-favicon', (done) => {
realFavicon.generateFavicon({
masterPicture: paths.source.favicon,
dest: paths.build.img,
iconsPath: '/images/',
design: {
ios: {
pictureAspect: 'backgroundAndMargin',
backgroundColor: '#cc0000',
margin: '14%',
assets: {
ios6AndPriorIcons: false,
ios7AndLaterIcons: false,
precomposedIcons: false,
declareOnlyDefaultIcon: true
}
},
desktopBrowser: {},
windows: {
pictureAspect: 'whiteSilhouette',
backgroundColor: '#ae1817',
onConflict: 'override',
assets: {
windows80Ie10Tile: false,
windows10Ie11EdgeTiles: {
small: false,
medium: true,
big: false,
rectangle: false
}
}
},
androidChrome: {
pictureAspect: 'noChange',
themeColor: '#ffffff',
manifest: {
name: 'Saiku Community',
display: 'standalone',
orientation: 'notSet',
onConflict: 'override',
declared: true
},
assets: {
legacyIcon: false,
lowResolutionIcons: false
}
},
safariPinnedTab: {
pictureAspect: 'silhouette',
themeColor: '#ae1817'
}
},
settings: {
scalingAlgorithm: 'Mitchell',
errorOnImageTooSmall: false
},
markupFile: FAVICON_DATA_FILE
}, () => {
done();
});
});

// Inject the favicon markups in your HTML pages. You should run
// this task whenever you modify a page. You can keep this task
// as is or refactor your existing HTML pipeline.
gulp.task('inject-favicon-markups', ['generate-favicon'], () => {
return gulp.src([`${paths.build.html}*.html`])
.pipe(realFavicon.injectFaviconMarkups(
JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).favicon.html_code)
)
.pipe(gulp.dest(paths.build.html));
});

// Check for updates on RealFaviconGenerator (think: Apple has just
// released a new Touch icon along with the latest version of iOS).
// Run this task from time to time. Ideally, make it part of your
// continuous integration system.
gulp.task('check-for-favicon-update', (done) => {
var currentVersion = JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).version;
realFavicon.checkForUpdates(currentVersion, (err) => {
if (err) {
throw err;
}
});
});

// Call Favicon Install
module.exports = gulp.task('favicon-install',
['generate-favicon', 'inject-favicon-markups']);
10 changes: 5 additions & 5 deletions gulp/tasks/imagemin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var cache = require('gulp-cache');
var imagemin = require('gulp-imagemin');
var paths = require('../paths');
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const cache = require('gulp-cache');
const imagemin = require('gulp-imagemin');
const paths = require('../paths');

// Call Imagemin
module.exports = gulp.task('imagemin', () => {
Expand Down
10 changes: 5 additions & 5 deletions gulp/tasks/jade.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var jade = require('gulp-jade');
var data = require('../../src/data/data');
var paths = require('../paths');
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const jade = require('gulp-jade');
const data = require('../../src/data/data');
const paths = require('../paths');

// Call Jade to compile templates
module.exports = gulp.task('jade', () => {
Expand Down
8 changes: 4 additions & 4 deletions gulp/tasks/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var paths = require('../paths');
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const uglify = require('gulp-uglify');
const paths = require('../paths');

// Call Uglify and concat JS
module.exports = gulp.task('js', () => {
Expand Down
20 changes: 10 additions & 10 deletions gulp/tasks/stylus.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var stylus = require('gulp-stylus');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var mqpacker = require('css-mqpacker');
var csswring = require('csswring');
var csscomb = require('gulp-csscomb');
var paths = require('../paths');
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const stylus = require('gulp-stylus');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const mqpacker = require('css-mqpacker');
const csswring = require('csswring');
const csscomb = require('gulp-csscomb');
const paths = require('../paths');

// Call Stylus
module.exports = gulp.task('stylus', () => {
var processors = [
const processors = [
autoprefixer({ browsers: ['last 3 versions'] }),
mqpacker,
csswring
Expand Down
6 changes: 3 additions & 3 deletions gulp/tasks/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
'use strict';

// Necessary Plugins
var gulp = require('gulp');
var paths = require('../paths');
const gulp = require('gulp');
const paths = require('../paths');

// Call Watch
module.exports = gulp.task('watch', () => {
gulp.watch(paths.source.templates, ['jade']);
gulp.watch(paths.source.templates, ['jade', 'favicon-install']);
gulp.watch(paths.source.js, ['js']);
gulp.watch(paths.source.styl, ['stylus']);
gulp.watch(paths.source.img, ['imagemin']);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"browser-sync": "^2.18.12",
"browser-sync": "^2.18.13",
"css-mqpacker": "^6.0.1",
"csswring": "^6.0.0",
"gulp": "^3.9.1",
Expand All @@ -61,6 +61,7 @@
"gulp-jade": "^1.1.0",
"gulp-plumber": "^1.1.0",
"gulp-postcss": "^7.0.0",
"gulp-real-favicon": "^0.2.2",
"gulp-stylus": "^2.6.0",
"gulp-uglify": "^3.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/data/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {
title: 'Wiki',
subtitle: 'wiki.meteorite.bi',
icon: 'file-text-o',
url: 'http://wiki.meteorite.bi/',
url: 'http://saiku-documentation.readthedocs.io/en/latest/',
id: null
},
{
Expand Down
Binary file removed src/favicon.ico
Binary file not shown.
Binary file removed src/images/favicon-16.png
Binary file not shown.
Binary file removed src/images/favicon-32.png
Binary file not shown.
Binary file removed src/images/favicon-48.png
Binary file not shown.
Binary file removed src/images/favicon-62.png
Binary file not shown.
File renamed without changes
7 changes: 0 additions & 7 deletions src/templates/inc/head.jade
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ head
meta(property="og:description" content="Saiku Analytics - The world's greatest open source OLAP browser.")
meta(property="og:site_name" content="Saiku Community")

//- Favicon
link(rel="icon" href="images/favicon-16.png" sizes="16x16" type="image/png")
link(rel="icon" href="images/favicon-32.png" sizes="32x32" type="image/png")
link(rel="icon" href="images/favicon-48.png" sizes="48x48" type="image/png")
link(rel="icon" href="images/favicon-62.png" sizes="62x62" type="image/png")
link(rel="icon" href="images/favicon-192.png" sizes="192x192" type="image/png")

//- Google Fonts
link(rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:300,400,700")

Expand Down
Loading

0 comments on commit 5e63b59

Please sign in to comment.