Skip to content

Commit

Permalink
0.4.0 massive update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Dec 24, 2013
1 parent 19c264e commit 7b5ac14
Show file tree
Hide file tree
Showing 111 changed files with 9,741 additions and 5,981 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

> Quickly launch Assemble-based projects using [grunt-init][], including starter templates and data.

## Getting started

### Installation
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-init-assemble",
"version": "0.3.4",
"description": "Initialize new Assemble projects, with example lodash mixins, handlebars helpers, templates and data.",
"version": "0.4.0",
"description": "Initialize new Assemble projects.",
"homepage": "https://github.com/assemble/assemble/",
"author": {
"name": "Jon Schlinkert",
Expand Down
3 changes: 0 additions & 3 deletions rename.json

This file was deleted.

28 changes: 21 additions & 7 deletions root/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
node_modules
npm-debug.log
lib-cov
*.csv
*.dat
*.gz
*.log
*.out
*.pid
*.rar
*.seed
*.sublime-*
*.zip

tmp
temp
pids
logs
results
build
npm-debug.log
TODO.md

*.sublime-*

_gh_pages
node_modules
_gh_pages
vendor
temp
tmp
118 changes: 88 additions & 30 deletions root/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,115 @@
* Licensed under the {%= licenses.join(', ') %} license{%= licenses.length === 1 ? '' : 's' %}.
*/

module.exports = function(grunt) {
'use strict';

module.exports = function(grunt) {
// Delete after first run
if(!grunt.file.exists('vendor/bootstrap')) {
grunt.fail.fatal('>> Please run "bower install" before continuing.');
}

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

// Project metadata
pkg : grunt.file.readJSON('package.json'),
vendor: grunt.file.readJSON('.bowerrc').directory,
site : grunt.file.readYAML('_config.yml'),
bootstrap: '<%= vendor %>/bootstrap',


// Before generating any new files, remove files from previous build.
clean: {
example: ['<%= site.dest %>/*.html'],
// Delete this target after first run!!!
once: ['<%= site.theme %>/bootstrap/{var*,mix*,util*}.less']
},


// Lint JavaScript
jshint: {
all: ['Gruntfile.js', 'helpers/*.js'],
all: ['Gruntfile.js', 'templates/helpers/*.js'],
options: {
jshintrc: '.jshintrc'
}
},


// Build HTML from templates and data
assemble: {
options: {
pkg: '<%= pkg %>',
flatten: true,
assets: '_gh_pages/assets',
partials: ['templates/includes/*.hbs'],
helpers: ['templates/helpers/*.js'],
layout: 'templates/layouts/default.hbs',
data: ['data/*.{json,yml}']
production: false,
assets: '<%= site.assets %>',
postprocess: require('pretty'),

// Metadata
pkg: '<%= pkg %>',
site: '<%= site %>',
data: ['<%= site.data %>'],

// Templates
partials: '<%= site.includes %>',
layoutdir: '<%= site.layouts %>',
layout: '<%= site.layout %>',

// Extensions
helpers: '<%= site.helpers %>',
plugins: '<%= site.plugins %>'
},
example: {
files: {'_gh_pages/': ['templates/*.hbs']}
files: {'<%= site.dest %>/': ['<%= site.templates %>/*.hbs']}
}
},


// Compile LESS to CSS
less: {
options: {
paths: '<%= vendor %>/bootstrap/less',
imports: {
reference: ['mixins.less', 'variables.less']
}
},
// Compile Bootstrap's LESS
bootstrap: {
src: [
'<%= vendor %>/bootstrap/less/bootstrap.less',
'<%= vendor %>/bootstrap/docs/assets/css/docs.css'
vendor: 'vendor',
paths: [
'<%= site.theme %>',
'<%= site.theme %>/bootstrap',
'<%= site.theme %>/components',
'<%= site.theme %>/utils'
],
dest: '<%= assemble.options.assets %>/bootstrap.css'
},
site: {
src: ['<%= site.theme %>/site.less'],
dest: '<%= site.assets %>/css/site.css'
}
},

// Before generating any new files,
// remove any previously-created files.
clean: {
example: ['_gh_pages/*.html']

// Copy Bootstrap's assets to site assets
copy: {
// Delete this target after first run!!! Afterwards you'll need to
// decide on a strategy for adding javascripts, fonts etc.
once: {
files: [
{expand: true, cwd: '<%= bootstrap %>/less', src: ['*', '!{var*,mix*,util*}'], dest: '<%= site.theme %>/bootstrap/'},
{expand: true, cwd: '<%= bootstrap %>/less', src: ['{util*,mix*}.less'], dest: '<%= site.theme %>/utils'},
{expand: true, cwd: '<%= bootstrap %>/less', src: ['variables.less'], dest: '<%= site.theme %>/'},
{expand: true, cwd: 'node_modules/showup', src: ['showup.js'], dest: '<%= site.assets %>/js/'},
{expand: true, cwd: 'node_modules/showup', src: ['showup.css'], dest: '<%= site.theme %>/components/', ext: '.less'},
]
},
// Keep this target as a getting started point
assets: {
files: [
{expand: true, cwd: '<%= bootstrap %>/dist/fonts', src: ['*.*'], dest: '<%= site.assets %>/fonts/'},
{expand: true, cwd: '<%= bootstrap %>/dist/js', src: ['*.*'], dest: '<%= site.assets %>/js/'},
]
}
},

watch: {
all: {
files: ['<%= jshint.all %>'],
tasks: ['jshint', 'nodeunit']
},
design: {
site: {
files: ['Gruntfile.js', '<%= less.options.paths %>/*.less', 'templates/**/*.hbs'],
tasks: ['design']
}
Expand All @@ -76,16 +122,28 @@ module.exports = function(grunt) {

// Load npm plugins to provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-readme');
grunt.loadNpmTasks('grunt-sync-pkg');
grunt.loadNpmTasks('assemble-less');
grunt.loadNpmTasks('assemble');

// Run this task once, then delete it as well as all of the "once" targets.
grunt.registerTask('setup', ['copy:once', 'clean:once']);

// Build HTML, compile LESS and watch for changes. You must first run "bower install"
// or install Bootstrap to the "vendor" directory before running this command.
grunt.registerTask('design', ['clean', 'assemble', 'less:bootstrap', 'watch:design']);
grunt.registerTask('design', ['clean', 'assemble', 'less:site', 'watch:site']);

grunt.registerTask('docs', ['readme', 'sync']);

// Default tasks to be run.
grunt.registerTask('default', ['clean', 'jshint', 'assemble', 'readme']);
};
// Delete this conditional logic after first run.
if(!grunt.file.exists('_gh_pages_/assets/fonts') && !grunt.file.exists('_gh_pages_/assets/js')) {
grunt.registerTask('default', ['setup', 'clean', 'jshint', 'copy:assets', 'assemble', 'less', 'docs']);
} else {
// Use this going forward.
grunt.registerTask('default', ['clean', 'jshint', 'copy:assets', 'assemble', 'less', 'docs']);
}
};
51 changes: 18 additions & 33 deletions root/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,40 @@
# {%= name %} [![NPM version](https://badge.fury.io/js/{%= name %}.png)](http://badge.fury.io/js/{%= name %}) {% if (travis) { %} [![Build Status]({%= travis %}.png)]({%= travis %}){% } %}
# {%= name %} [![NPM version](https://badge.fury.io/js/{%= name %}.png)](http://badge.fury.io/js/{%= name %})

> {%= description %}
### [Visit the docs →](http://{%= username %}.github.io/{%= name %})
> Boilerplate for [Assemble](https://github.com/assemble/assemble)
Created and maintained by [Jon Schlinkert](http://twitter.com/jonschlinkert) and [Brian Woodward](http://twitter.com/doowb).
Please [create an issue](https://github.com/assemble/boilerplate/issues) if you find a bug or have a feature request.

## Getting Started

## Quick start

The following quick start options are available:
**1. Download the project**

* Install with [Bower](http://bower.io): `bower install {%= name %}`.
* Clone the repo: `git clone {%= repository %}`.
* [Download the latest release]({%= homepage %}/archive/master.zip).
Install the project locally using one of the following options:

* Using git: `git clone git://github.com/assemble/boilerplate.git`
* [Download the project](https://github.com/assemble/boilerplate/archive/master.zip)

## Getting Started
Install the module with: `npm install {%= name %}`
Next, to optionally install [Bootstrap](https://github.com/twbs/bootstrap) using [Bower](https://github.com/bower/bower), simply run

```javascript
var {%= js_safe_name %} = require('{%= name %}');
{%= js_safe_name %}.foo(); // "bar"
```bash
bower install
```

## Documentation

_(Coming soon)_


## Options
**2. Install Dependencies**

_(Coming soon)_
Run `npm i` to install dependencies.

**3. Build**

## Examples
If everything installed correctly, running `grunt` in the command line should successfully build the project to the `./_gh_pages` directory inside the project.

_(Coming soon)_
**4. Remove "first run" Targets**

Inside the [Gruntfile](./Gruntfile.js) you will find a few targets that should be removed after the first run. These are labeled accordingly.

## Contributing

Please read through the [contributing guidelines](CONTRIBUTING.md). 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/).

Editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at [http://editorconfig.org](http://editorconfig.org).


## Release History

* {%= grunt.template.today('yyyy') %}   v0.1.0   First commit

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][].

## License
Copyright (c) {%= grunt.template.today('yyyy') %} {%= author_name %}
Expand Down
Loading

0 comments on commit 7b5ac14

Please sign in to comment.