Skip to content

Commit

Permalink
- move compiled css into version tag folder
Browse files Browse the repository at this point in the history
- remove base-url from inline-images. path is resolved by compass (images_dir)
- commend out compass configs that get overwritten in gulpfile
- update gulpfile to build into version tag folder
- update paths in css and templates accordingly
  • Loading branch information
tralafiti committed Apr 6, 2018
1 parent 5b9f939 commit e65eb5c
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 110 deletions.
4 changes: 2 additions & 2 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

http_path = "/"
# project_path = ''
css_dir = 'public/css'
sass_dir = 'sass'
# css_dir = 'public/css'
# sass_dir = 'sass'
images_dir = 'public/img'
generated_images_path = 'img_cache'
# javascripts_dir = 'javascripts'
Expand Down
90 changes: 44 additions & 46 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,46 @@ let uglifyJsOptions = {
toplevel: false
};

// parse pathfinder.ini config file for relevant data
let tagVersion;
try{
let pathfinderIni = ini.parse(fs.readFileSync(pathfinderConfigFile, 'utf-8'));
try{
tagVersion = pathfinderIni.PATHFINDER.VERSION;
}catch(err){
printError(
err.message,
'Missing "PATHFINDER.VERSION" in "' + pathfinderConfigFile + '"');
process.exit(1);
}
}catch(err){
printError(
err.message,
'Check read permissions for "' + pathfinderConfigFile + '"');
process.exit(1);
}

// parse CLI parameters
let options = minimist(process.argv.slice(2));

// custom task configuration (user CLI options if provided) (overwrites default)
let CONF = {
TASK: options.hasOwnProperty('_') ? options._[0] : undefined,
TAG: options.tag ? options.tag : tagVersion ? tagVersion : undefined,
JS: {
UGLIFY: options.hasOwnProperty('jsUglify') ? options.jsUglify === 'true': undefined,
SOURCEMAPS: options.hasOwnProperty('jsSourcemaps') ? options.jsSourcemaps === 'true': undefined,
GZIP: options.hasOwnProperty('jsGzip') ? options.jsGzip === 'true': undefined,
BROTLI: options.hasOwnProperty('jsBrotli') ? options.jsBrotli === 'true': undefined
},
CSS: {
SOURCEMAPS: options.hasOwnProperty('cssSourcemaps') ? options.cssSourcemaps === 'true': undefined,
GZIP: options.hasOwnProperty('cssGzip') ? options.cssGzip === 'true': undefined,
BROTLI: options.hasOwnProperty('cssBrotli') ? options.cssBrotli === 'true': undefined
},
DEBUG: false
};

// Sourcemaps options
// https://www.npmjs.com/package/gulp-sourcemaps

Expand All @@ -119,7 +159,7 @@ let brotliOptions = {

let compassOptions = {
config_file: './config.rb',
css: 'public/css',
css: 'public/css/' + CONF.TAG,
sass: 'sass',
time: true, // show execution time
sourcemap: true
Expand Down Expand Up @@ -147,48 +187,6 @@ let printError = (title, example) => {
gutil.log(chalk.red('='.repeat(cliBoxLength))).log('');
};

// == Settings ========================================================================================================

// parse pathfinder.ini config file for relevant data
let tagVersion;
try{
let pathfinderIni = ini.parse(fs.readFileSync(pathfinderConfigFile, 'utf-8'));
try{
tagVersion = pathfinderIni.PATHFINDER.VERSION;
}catch(err){
printError(
err.message,
'Missing "PATHFINDER.VERSION" in "' + pathfinderConfigFile + '"');
process.exit(1);
}
}catch(err){
printError(
err.message,
'Check read permissions for "' + pathfinderConfigFile + '"');
process.exit(1);
}

// parse CLI parameters
let options = minimist(process.argv.slice(2));

// custom task configuration (user CLI options if provided) (overwrites default)
let CONF = {
TASK: options.hasOwnProperty('_') ? options._[0] : undefined,
TAG: options.tag ? options.tag : tagVersion ? tagVersion : undefined,
JS: {
UGLIFY: options.hasOwnProperty('jsUglify') ? options.jsUglify === 'true': undefined,
SOURCEMAPS: options.hasOwnProperty('jsSourcemaps') ? options.jsSourcemaps === 'true': undefined,
GZIP: options.hasOwnProperty('jsGzip') ? options.jsGzip === 'true': undefined,
BROTLI: options.hasOwnProperty('jsBrotli') ? options.jsBrotli === 'true': undefined
},
CSS: {
SOURCEMAPS: options.hasOwnProperty('cssSourcemaps') ? options.cssSourcemaps === 'true': undefined,
GZIP: options.hasOwnProperty('cssGzip') ? options.cssGzip === 'true': undefined,
BROTLI: options.hasOwnProperty('cssBrotli') ? options.cssBrotli === 'true': undefined
},
DEBUG: false
};

// == Helper methods ==================================================================================================

/**
Expand Down Expand Up @@ -485,7 +483,7 @@ gulp.task('task:cleanJsBuild', () => del([PATH.JS.DIST_BUILD]));
/**
* clean CSS build dir
*/
gulp.task('task:cleanCssBuild', () => del([PATH.ASSETS.DIST + '/css']));
gulp.task('task:cleanCssBuild', () => del([PATH.ASSETS.DIST + '/css/' + CONF.TAG]));

/**
* clean JS destination (final) dir
Expand Down Expand Up @@ -667,7 +665,7 @@ gulp.task('task:sass', () => {
trackFile(data, {src: 'startSize', src_percent: 'percent', uglify: 'endSize'});
return chalk.green('Build CSS file "' + data.fileName + '"');
}))
.pipe(gulp.dest(PATH.ASSETS.DIST + '/css'));
.pipe(gulp.dest(PATH.ASSETS.DIST + '/css/' + CONF.TAG));
});

/**
Expand All @@ -679,7 +677,7 @@ gulp.task('task:cleanCss', () => {
compatibility: '*',
level: 2
}))
.pipe(gulp.dest(PATH.ASSETS.DIST +'/css'));
.pipe(gulp.dest(PATH.ASSETS.DIST +'/css/' + CONF.TAG));
});

// == Helper tasks ====================================================================================================
Expand Down
51 changes: 0 additions & 51 deletions public/css/pathfinder.css

This file was deleted.

51 changes: 51 additions & 0 deletions public/css/v1.3.4/pathfinder.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/templates/view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<meta name="google-site-verification" content="sHoh0gfMw3x1wiwLTK5OsKsxt7kRgxi69hRgWEGh9DQ" /> {* Youtube verification code *}

<set pathCSS="{{ @BASE . '/public/css/pathfinder.css?' . @PATHFINDER.VERSION }}" />
<set pathCSS="{{ @BASE . '/public/css/' . @PATHFINDER.VERSION . '/pathfinder.css' }}" />
<set pathJSApp="{{ @BASE . '/' . @tplPathJs . '/app' }}" />
<set pathJSRequire="{{ @BASE . '/' . @tplPathJs . '/lib/require.js' }}" />

Expand Down
6 changes: 3 additions & 3 deletions sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $link-hover-color: darken($link-color, 15%);
//
//## Font, line-height, and color for body text, headings, and more.

$pf-font-path: "../fonts" !default;
$pf-font-path: "../../fonts" !default;

@font-face {
font-family: 'Oxygen';
Expand Down Expand Up @@ -105,7 +105,7 @@ $headings-color: inherit;
//
//## Specify custom locations of the include Glyphicons icon font. Useful for those including Bootstrap via Bower.

$icon-font-path: "../fonts/";
$icon-font-path: "../../fonts/";
$icon-font-name: "glyphicons-halflings-regular";
$icon-font-svg-id: "glyphicons_halflingsregular";

Expand Down Expand Up @@ -805,7 +805,7 @@ $animation-ajax-dropdown: "flipInY";
//
//##

$base-url: "../img";
$base-url: "../../img";
//urage: background-image: url("#{$base-url}/images/bg.png");

$html-background-image: "";
Expand Down
4 changes: 2 additions & 2 deletions sass/layout/_images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
}

.pf-icon-dotlan{
background: inline-image("#{$base-url}/icons/dotlan_logo.png");
background: inline-image("/icons/dotlan_logo.png");
width: 17px;
height: 17px;
opacity: 0.8;
margin: -5px 0px 0 10px;
}

.pf-icon-wormhol-es{
background: inline-image("#{$base-url}/icons/wormhol_es_logo.png");
background: inline-image("/icons/wormhol_es_logo.png");
width: 17px;
height: 17px;
opacity: 0.8;
Expand Down
2 changes: 1 addition & 1 deletion sass/layout/_map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ $mapWrapperMaxWidth: $mapWidth + 35px;

// 20x20px grid background
.pf-grid-small{
background: inline-image("#{$base-url}/grid_40x40.png") !important;
background: inline-image("/grid_40x40.png") !important;
}

.pf-map{
Expand Down
2 changes: 1 addition & 1 deletion sass/library/custom-scrollbar/_mCustomScrollbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ yx-axis
.mCSB_scrollTools .mCSB_buttonLeft,
.mCSB_scrollTools .mCSB_buttonRight{
//background-image: url(mCSB_buttons.png); /* css sprites */
background: inline-image("#{$base-url}/custom-scrollbar/mCSB_buttons.png"); /* css sprites */
background: inline-image("/custom-scrollbar/mCSB_buttons.png"); /* css sprites */
background-repeat: no-repeat;
opacity: 0.4; filter: "alpha(opacity=40)"; -ms-filter: "alpha(opacity=40)";
}
Expand Down
2 changes: 1 addition & 1 deletion sass/library/fontawesome/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Variables
// --------------------------

$fa-font-path: "../fonts" !default;
$fa-font-path: "../../fonts" !default;
$fa-font-size-base: 16px !default;
$fa-css-prefix: fa !default;
$fa-version: "5.0.2" !default;
Expand Down

0 comments on commit e65eb5c

Please sign in to comment.