Skip to content

Commit

Permalink
Add Github information, minor fixes to generator
Browse files Browse the repository at this point in the history
Since the updated layout for Jekyll includes a Github field, we need to
add this to the generator as well. Also did some minor grammatical
tweaks and changes to the questions asked to the user.
  • Loading branch information
sondr3 committed Apr 1, 2016
1 parent ca98d6b commit a332153
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
13 changes: 9 additions & 4 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = generators.Base.extend({
store: true
}, {
name: 'projectURL',
message: chalk.yellow('If you are using GHPages use username.github.io\n') +
message: chalk.yellow('If you will be using Github Pages, use username.github.io\n') +
chalk.yellow('? ') + 'What will the URL for your project be?',
store: true
}, {
Expand All @@ -61,7 +61,7 @@ module.exports = generators.Base.extend({
store: true
}, {
name: 'authorURI',
message: chalk.yellow('Can be the same as this site!\n') +
message: chalk.yellow('Can be the same as this site\n') +
chalk.yellow('? ') + 'What is your homepage?',
store: true
}, {
Expand All @@ -70,8 +70,12 @@ module.exports = generators.Base.extend({
store: true
}, {
name: 'authorTwitter',
message: chalk.yellow('Don\'t include @ in front of your username\n') +
chalk.yellow('? ') + 'Your Twitter handle:',
message: chalk.blue('You can leave these blank if they are not going to be used\n') +
chalk.yellow('? ') + 'Your Twitter handle ' + chalk.yellow('(without the @):'),
store: true
}, {
name: 'authorGithub',
message: 'Your Github username:',
store: true
}, {
name: 'uploading',
Expand Down Expand Up @@ -143,6 +147,7 @@ module.exports = generators.Base.extend({
authorURI: this.props.authorURI,
authorBio: this.props.authorBio,
authorTwitter: this.props.authorTwitter,
authorGithub: this.props.authorGithub,
jekyllPermalinks: this.props.jekyllPermalinks
}
}, {
Expand Down
9 changes: 8 additions & 1 deletion generators/jekyll/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ module.exports = generators.Base.extend({
this.option('authorTwitter', {
type: String,
required: true,
desc: 'Author twitter'
desc: 'Author Twitter'
});

this.option('authorGithub', {
type: String,
required: true,
desc: 'Author Github'
});

this.option('jekyllPermalinks', {
Expand Down Expand Up @@ -79,6 +85,7 @@ module.exports = generators.Base.extend({
authorURI: this.options.authorURI,
authorBio: this.options.authorBio,
authorTwitter: this.options.authorTwitter,
authorGithub: this.options.authorGithub,
jekyllPermalinks: this.options.jekyllPermalinks
}
);
Expand Down
2 changes: 1 addition & 1 deletion test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ describe('jekyllized:app', function () {
authorEmail: '[email protected]',
authorBio: 'A norwegian dude',
authorTwitter: '0lanordmann',
authorGithub: '0lanordmann',
uploading: 'None',
jekyllPermalinks: 'pretty',
jekyllPaginate: '10'
};
this.deps = [
[helpers.createDummyGenerator(), 'jekyllized:boilerplate'],
[helpers.createDummyGenerator(), 'jekyllized:bower'],
[helpers.createDummyGenerator(), 'jekyllized:gulp'],
[helpers.createDummyGenerator(), 'jekyllized:jekyll']
];
Expand Down
8 changes: 5 additions & 3 deletions test/jekyll.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ describe('jekyllized:jekyll', function () {
authorEmail: '[email protected]',
authorURI: 'homepage.com',
authorBio: 'I am a tester for tests',
authorTwitter: '0lanordmann'
authorTwitter: '0lanordmann',
authorGithub: '0lanordmann'
};
helpers.run(path.join(__dirname, '../generators/jekyll'))
.inDir(path.join(__dirname, 'tmp/jekyll'))
Expand Down Expand Up @@ -47,14 +48,15 @@ describe('jekyllized:jekyll', function () {

it('_config.yml contains the correct settings', function () {
[
'name: jekyllized',
'title: jekyllized',
'description: Tests for Jekyllized',
'url: example.org',
'name: Ola Nordmann',
'email: [email protected]',
'uri: homepage.com',
'bio: I am a tester for tests',
'twitter: 0lanordmann'
'twitter: 0lanordmann',
'github: 0lanordmann'
].forEach(function (config) {
assert.fileContent('_config.yml', config);
});
Expand Down

0 comments on commit a332153

Please sign in to comment.