mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-10 15:57:07 +01:00
Integrate JRSTheme class.
This commit is contained in:
@ -17,7 +17,8 @@ Definition of the TemplateGenerator class.
|
||||
, MKDIRP = require('mkdirp')
|
||||
, BaseGenerator = require( './base-generator' )
|
||||
, EXTEND = require('../utils/extend')
|
||||
, Theme = require('../core/theme');
|
||||
, FRESHTheme = require('../core/fresh-theme')
|
||||
, JRSTheme = require('../core/jrs-theme');
|
||||
|
||||
|
||||
|
||||
@ -220,20 +221,28 @@ Definition of the TemplateGenerator class.
|
||||
Given a theme title, load the corresponding theme.
|
||||
*/
|
||||
function themeFromMoniker() {
|
||||
|
||||
// Verify the specified theme name/path
|
||||
var tFolder = PATH.join(
|
||||
parsePath( require.resolve('fluent-themes') ).dirname,
|
||||
this.opts.theme
|
||||
);
|
||||
var exists = require('path-exists').sync;
|
||||
if( !exists( tFolder ) ) {
|
||||
tFolder = PATH.resolve( this.opts.theme );
|
||||
if( !exists( tFolder ) ) {
|
||||
throw { fluenterror: this.codes.themeNotFound, data: this.opts.theme};
|
||||
}
|
||||
}
|
||||
|
||||
var t = this.opts.themeObj || new Theme().open( tFolder );
|
||||
var t;
|
||||
if( this.opts.theme.startsWith('jsonresume-theme-') ) {
|
||||
console.log('LOADING JSON RESUME');
|
||||
t = new JRSTheme().open( tFolder );
|
||||
}
|
||||
else {
|
||||
var exists = require('path-exists').sync;
|
||||
if( !exists( tFolder ) ) {
|
||||
tFolder = PATH.resolve( this.opts.theme );
|
||||
if( !exists( tFolder ) ) {
|
||||
throw { fluenterror: this.codes.themeNotFound, data: this.opts.theme};
|
||||
}
|
||||
}
|
||||
t = this.opts.themeObj || new FRESHTheme().open( tFolder );
|
||||
}
|
||||
|
||||
// Load the theme and format
|
||||
return {
|
||||
|
Reference in New Issue
Block a user