diff --git a/app/USAGE b/app/USAGE index 0612a60..d6037a9 100644 --- a/app/USAGE +++ b/app/USAGE @@ -1,10 +1,3 @@ -Description: - Creates a default Assemble app - -Options: - --skip-install: Skips the automatic execution of `bower` and `npm` - after scaffolding has finished. - --s: alias --skip-install - Example: - yo assemble [--skip-install] [--silent] + yo assemble --init --skip-install --skip-welcome-message + yo assemble -i -s -w (alias) diff --git a/app/index.js b/app/index.js index 3c4d4c3..6bd0a8e 100644 --- a/app/index.js +++ b/app/index.js @@ -12,6 +12,19 @@ var AssembleGenerator = module.exports = function AssembleGenerator(args, option yeoman.generators.Base.apply(this, arguments); + this.description = 'Creates a default Assemble boilerplate'; + + // Not required but need to show when user command `yo assemble -h` + this.option('init', { + alias: 'i', + desc: 'Force to prompt question and re-initialize of .yo-rc.json', + type: String, + defaults: false, + required: false + }); + + this.init = options['init'] || options['i'] || false; + this.on('end', function () { this.installDependencies({ skipInstall: options['skip-install'] || options['s'], @@ -56,7 +69,8 @@ AssembleGenerator.prototype.askFor = function askFor() { var done = this.async(); var force = false; - if (!this.config.existed) { + + if (!this.config.existed || this.init) { force = true; } @@ -73,6 +87,13 @@ AssembleGenerator.prototype.askFor = function askFor() { default : this.appname }); + (!this.config.get("projectDesc") || force) && questions.push({ + type : "input", + name : "projectDesc", + message : "Your project description", + default : this.config.get("projectDesc") + }); + (!this.config.get("githubUser") || force) && questions.push({ type : "input", name : "githubUser", @@ -107,6 +128,7 @@ AssembleGenerator.prototype.askFor = function askFor() { this.prompt(questions, function (answers) { this.projectName = answers.projectName || this.config.get("projectName"); + this.projectDesc = answers.projectDesc || this.config.get("projectDesc"); this.authorLogin = answers.githubUser || this.config.get("githubUser"); this.plugin = answers.plugin; this.authorName = this.config.get("author").name; diff --git a/app/templates/README.md b/app/templates/README.md index 8f57631..64fc725 100644 --- a/app/templates/README.md +++ b/app/templates/README.md @@ -1,9 +1,17 @@ -# assemble +# <%= _.slugify(projectName) %> -> Assemble a website from templates and data. +> <%= _.capitalize(projectDesc) %>. + +## [Assemble](http://assemble.io/) + +Assemble is a component and static site generator that makes it dead simple to build modular sites, documentation and components from reusable templates and data. + +* Documentation +* Plugins - Plugins extend the core functionality of Assemble. +* Helpers - Documentation for the helpers in the [handlebars-helpers](http://github.com/assemble/handlebars-helpers) library. ## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][http://gruntjs.com/]. +All contributions are welcome! The simplest way to show your support for this project is to **"star" it**. Please see [Contributing to Assemble](http://assemble.io/contributing) for more information. ## Release History -_(Nothing yet)_ + * <%= (new Date).toISOString().split('T')[0] %> v0.1.0 Generated by the [Yeoman Generator](https://github.com/assemble/generator-assemble) for [Assemble](http://assemble.io) diff --git a/app/templates/_package.json b/app/templates/_package.json index 0ad5e4b..a7ca1c2 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -1,8 +1,8 @@ { "name": "<%= _.slugify(projectName) %>", - "description": "Assemble a website from templates and data.", + "description": "<%= _.capitalize(projectDesc) %>.", "version": "0.1.0", - "homepage": "http://assemble.io", + "homepage": "https://github.com/<%= authorLogin %>/<%= _.slugify(projectName) %>", "author": { "name": "<%= authorName %>", "url": "http://github.com/<%= authorLogin %>/" @@ -21,13 +21,13 @@ "test": "grunt assemble" }, "devDependencies": { - "assemble": "~0.4.22", - "grunt": "~0.4.1", + "assemble": "~0.4.33", + "grunt": "~0.4.2", "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-connect": "~0.5.0", + "grunt-contrib-connect": "~0.6.0", "grunt-contrib-watch": "~0.5.3", - "load-grunt-tasks": "~0.1.3", - "time-grunt": "~0.1.1"<% if(plugin && plugin.length > 0){ %>, + "load-grunt-tasks": "~0.2.1", + "time-grunt": "~0.2.7"<% if(plugin && plugin.length > 0){ %>, <% if(typeof plugin === 'object'){ _.each(plugin, function(name, i) { %> "<%= name %>": "*"<% if(i < (plugin.length - 1)) { %>,<% } %> <% }); } else { %> diff --git a/app/templates/src/templates/layouts/default.hbs b/app/templates/src/templates/layouts/default.hbs index 5a29b64..c892e57 100644 --- a/app/templates/src/templates/layouts/default.hbs +++ b/app/templates/src/templates/layouts/default.hbs @@ -8,7 +8,7 @@
- {{> navbar-fixed-top }} @@ -31,6 +31,6 @@ {{> body }} - + -