Skip to content

Commit

Permalink
Further restructurings of the index.js file, mostly minor improvement…
Browse files Browse the repository at this point in the history
…s. And updated the bower and package file to return appname, not projectname. Also upped the version to 0.0.2. Fixes #2
  • Loading branch information
sondr3 committed Jan 24, 2014
1 parent d215c66 commit d8b3737
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
35 changes: 16 additions & 19 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var JekyllizeGenerator = module.exports = function PlaybookGenerator(args, optio
shelljs.exit(1);
}

// Find some defaults to fill in with
this.gitInfo = {
ownerName: this.user.git.username,
ownerEmail: this.user.git.email
Expand All @@ -38,7 +39,7 @@ util.inherits(JekyllizeGenerator, yeoman.generators.Base);
JekyllizeGenerator.prototype.askForProject = function askForProject() {
var cb = this.async();
var prompts = [
{
{
name: 'projectname',
message: 'What is the name of the project?'
},
Expand All @@ -52,7 +53,7 @@ JekyllizeGenerator.prototype.askForProject = function askForProject() {
}
];

// Fill in information about the project and owner
// Fill in information about the project itself
console.log(this.yeoman);
console.log(chalk.yellow('\nTell us a little about the project.') + ' →');

Expand Down Expand Up @@ -93,10 +94,10 @@ JekyllizeGenerator.prototype.askforOwner = function askforOwner() {
}
];

console.log(this.yeoman);
// This is to fill out the information about the owner
console.log(chalk.yellow('\nNow tell us about yourself.') + ' →');

this prompt(prompts, function (props) {
this.prompt(prompts, function (props) {

this.ownerName = props.ownerName;
this.ownerEmail = props.ownerEmail;
Expand All @@ -110,7 +111,8 @@ JekyllizeGenerator.prototype.askforOwner = function askforOwner() {

JekyllizeGenerator.prototype.askForTools = function askForTools() {
var cb = this.async();
var prompts = [{
var prompts = [
{
name: 'cssPre',
type: 'list',
message: 'CSS preprocessor',
Expand Down Expand Up @@ -322,28 +324,24 @@ JekyllizeGenerator.prototype.askForDeployment = function askForDeployment() {
JekyllizeGenerator.prototype.askForJekyll = function askForJekyll() {
var cb = this.async();
var prompts = [{
name: 'jekDescript',
message: 'Site description'
},
{
name: 'jekPost',
name: 'jekyllPermalinks',
type: 'list',
message: 'Post permalink style',
choices: ['date', 'pretty', 'none']
},
{
name: 'jekMkd',
name: 'markdownEngine',
type: 'list',
message: 'Markdown library',
choices: ['redcarpet', 'maruku', 'rdiscount', 'kramdown']
},
{
name: 'jekPyg',
name: 'jekyllPygments',
type: 'confirm',
message: 'Use the Pygments code highlighting library?'
},
{
name: 'jekPage',
name: 'jekyllPageinate',
message: 'Number of posts to show on the home page',
default: 'all',
validate: function (input) {
Expand All @@ -362,11 +360,10 @@ JekyllizeGenerator.prototype.askForJekyll = function askForJekyll() {

this.prompt(prompts, function (props) {

this.jekPyg = props.jekPyg;
this.jekMkd = props.jekMkd;
this.jekPost = props.jekPost;
this.jekDescript = props.jekDescript;
this.jekPage = /^all$/i.test(props.jekPage) ? false : props.jekPage;
this.jekyllPygments = props.jekyllPygments;
this.markdownEngine = props.markdownEngine;
this.jekyllPermalinks = props.jekyllPermalinks;
this.jekyllPageinate = /^all$/i.test(props.jekyllPageinate) ? false : props.jekyllPageinate;

cb();
}.bind(this));
Expand Down Expand Up @@ -539,7 +536,7 @@ JekyllizeGenerator.prototype.templates = function templates() {

JekyllizeGenerator.prototype.pygments = function pygments() {
// Pygments styles
if (this.jekPyg) {
if (this.jekyllPygments) {
this.copy(path.join(this.jekyllTmp, 'css/syntax.css'), path.join('app', this.cssDir, 'syntax.css'));
}
};
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Gemfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "http://rubygems.org"

gem 'jekyll', '~>1.4.0'
gem '<%= jekMkd %>'<% if (cssPre === 'sass') { %>
gem '<%= markdownEngine %>'<% if (cssPre === 'sass') { %>
gem 'sass', '>=3.2'<% } %><% if (cssPre === 'compass') { %>
gem 'compass', '>=0.12'<% } %>
2 changes: 1 addition & 1 deletion app/templates/_bower.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "<%= _.slugify(projectname) %>",
"name": "<%= _.slugify(appname) %>",
"version": "0.0.2",
"dependencies": {<%
var depn = [];
Expand Down
4 changes: 2 additions & 2 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "<%= _.slugify(projectname) %>",
"name": "<%= _.slugify(appname) %>",
"private": true,
"version": "0.0.2",
"description": "Yeoman workflow for <%= projectname %>",
"description": "Yeoman workflow for <%= appname %>",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",<% if (autoPre) { %>
Expand Down

0 comments on commit d8b3737

Please sign in to comment.