Skip to content

Commit

Permalink
Merge pull request #152 from rcherny/master
Browse files Browse the repository at this point in the history
This pull request merges master.next into master
  • Loading branch information
rcherny committed Aug 24, 2015
2 parents ccae6ac + 2b0b5ba commit 2c137e7
Show file tree
Hide file tree
Showing 187 changed files with 9,302 additions and 14,570 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.err
*.orig
*.log
*.map
*.rej
*.swo
*.swp
Expand Down
9 changes: 0 additions & 9 deletions Gemfile

This file was deleted.

48 changes: 0 additions & 48 deletions Gemfile.lock

This file was deleted.

168 changes: 117 additions & 51 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,50 @@ module.exports = function(grunt) {

// @todo: move to json file
var standards = {
ourLanguages : ['en', 'es', 'nglayout'], // nglayout? just showing my age
ourLanguages : ['en', 'es'],
defaultFile : 'index',
defaultExt : '.html',
// change this to have the 'index' file be another language
defaultLanguage : 'en'
};

// output build time stats
require('time-grunt')(grunt);

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

// combine our files into one file, language by language
assemble: {
options: {
marked: {
sanitize: false
},
flatten : true,
layout: './src/_layouts/main.hbs'
},
en: {
options : {
data : 'src/content/en/build/data.json'
},
files : {
'en.html' : ['src/content/en/build/en.hbs']
}
},
/*es: {
options : {
data : 'src/content/es/build/data.json'
},
files : {
'es.html' : ['src/content/es/build/es.hbs']
}
},*/
},

// clean up after the previous build
clean : {
clean: {
build : (function(){
var arr = [];

Expand All @@ -31,82 +61,118 @@ module.exports = function(grunt) {
arr.push(standards.defaultFile + standards.defaultExt);

return arr;
}())
}()),
assets: ['_assets/**/*']
},

// watch the file system for new changes
watch: {
css: {
files: ['scss/*.scss'],
tasks: ['compass']
// concatenate the js files into one
concat: {
js: {
options: {
separator: ';',
},
files: {
'_assets/js/main.js': ['src/js/**/*.js','!src/js/vendor/jquery-*min.js']
}
}
},

compass: {
dist: {
// connect to the local server
connect: {
server: {
options: {
config: 'config.rb'
port: 8000,
hostname: '127.0.0.1',
keepalive: true
}
}
},

// combine our files into one file, language by language
assemble: {
options: {
marked: {
sanitize: false
},
flatten : true,
layout: './_layouts/main.hbs'
// copy the specified default language to the specified file
copy: {
assets: {
expand: true,
cwd: 'src/js/vendor/',
src: ['jquery*min.js'],
dest: '_assets/js/vendor/'
},
en: {
options : {
data : 'sections/en/build/data.json',
partials: ['sections/en/*.html']
},
files : {
'en.html' : ['sections/en/build/en.hbs']
}
// mat be replaced by imagemin
images: {
expand: true,
cwd: 'src/img',
src: ['**/*.{png,jpg,gif,svg,ico}'],
dest: '_assets/img/'
},
es: {
options : {
data : 'sections/es/build/data.json',
partials: ['sections/es/*.html']
realeaseLanguage : {
src : standards.defaultLanguage + standards.defaultExt,
dest : standards.defaultFile + standards.defaultExt
}
},

// run sass to generate the css
sass: {
global: {
options: {
sourceMap: true,
sourceComments: false,
outputStyle: 'expanded'
},
files : {
'es.html' : ['sections/es/build/es.hbs']
}
},
// this is a new test layout + new content
nglayout: {
options : {
data : 'content/en/build/data.json'
files: [{
expand: true,
cwd: 'src/scss/',
src: ['*.scss', '!js-only.scss'],
dest: '_assets/css/',
ext: '.css'
},
src : 'content/en/build/en.hbs',
dest : 'nglayout.html'
],
}
},

// watch the file system for new changes
watch: {
css: {
files: ['src/scss/**/*.scss'],
tasks: ['sass']
},
html: {
files: ['src/_layouts/**.*', 'src/content/en/**/*.*'],
tasks: ['assemble','copy']
},
img: {
files: ['src/img/**/*.{png,jpg,gif}'],
tasks: ['copy:images'] // may be replaced by imagemin
},
js: {
files: ['src/js/**/*.js'],
tasks: ['concat', 'uglify', 'copy:assets']
}
},

// copy the specified default language to the specified file
copy : {
realeaseLanguage : {
src : standards.defaultLanguage + standards.defaultExt,
dest : standards.defaultFile + standards.defaultExt
// minify the js
uglify: {
target: {
files: {
'_assets/js/main.min.js': ['_assets/js/main.js']
}
}
}

});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('assemble');

// Default task.
grunt.registerTask('cleanup', ['clean']);
grunt.registerTask('default', ['clean', 'compass', 'assemble', 'copy']);
grunt.registerTask('watch', ['watch']);
grunt.registerTask('server', ['connect']);
grunt.registerTask('default', ['clean', 'sass', 'concat', 'uglify', 'assemble', 'copy']);
grunt.registerTask('dev', ['watch']);

};
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@ All content licensed under Creative Commons Attribution 3.0 Unported License

## Summary:

> **Updated 24 June, 2014**
>
> A new branch has been created where we will swap the new markdown content and the new HTML/CSS layout for the next version. We will also clean up and remove the older unused files there as it will be virtually rewritten.
>
> Keep a watch on the `master.next` branch.
This document contains guidelines for web applications built by the Front-end development practice of Isobar. It is to be readily available to anyone who wishes to check or contribute to the iterative progress of our discipline's best practices.

This document's primary motivation is two- fold:
This document's primary motivation is two-fold:

1. code consistency and
2. best practices.
Expand All @@ -25,7 +19,7 @@ We hope to encourage other developers to think about how to best standardize the

## Intent for Build and Content

We hope to seperate the structure of the document from the content contained in the standards themselves. Effectively, our goal is to be able to easily update the content without having to worry about the structure.
We hope to separate the structure of the document from the content contained in the standards themselves. Effectively, our goal is to be able to easily update the content without having to worry about the structure.

This also enables pull requests to focus on content and forks to the content to be easily re-branded.

Expand All @@ -43,12 +37,10 @@ To make changes using the process in place, please use the build process. The ne

### Requirements

The build system uses [Grunt.js](http://gruntjs.com) via [Node.js](http://nodejs.org/) and [SASS](http://sass-lang.com/) via [Compass](http://compass-style.org/).
The build system uses [Grunt.js](http://gruntjs.com) via [Node.js](http://nodejs.org/) and [SASS](http://sass-lang.com/) via [libsass](http://libsass.org/).

First, install [Node.js](http://nodejs.org) from their Web site.

Then, prior to running the build commands, make sure you have ruby 1.9.3 installed, ideally using [RVM](https://rvm.io/rvm/install) (Mac OS X and Linux) or [RubyInstaller](http://rubyinstaller.org/downloads/) (Windows).

### Build Details

We are using [Grunt](https://github.com/gruntjs/) to run the [Assemble](https://github.com/assemble/assemble/) task to parse, populate variables, and combine files for the HTML, Markdown, and [Handlebars](http://handlebarsjs.com/) templates.
Expand Down Expand Up @@ -87,20 +79,25 @@ Finally, the `standards.defaultLanguage` setting determines which `*.html` file
#### Content

The content is written in Markdown files and the build converts it to HTML. Example:

```
./sections/[lang]/*.html
./sections/[lang]/*.md
./src/content/[lang]/css.md
./src/content/[lang]/general.md
./src/content/[lang]/html.md
```

Each of the `.html` files (and soon `.md` - Markdown) contained within these directories is a portion of the final output file. We have separated the different sections that make up the page into individual files so that it is easier to edit.
...and so on.

Each of the `.md` files contained within these directories is a portion of the final output file. We have separated the different sections that make up the page into individual files so that it is easier to edit.

#### Including A Content File

The content files are included as partials and the data and order is defined in the following folder and files:

```
./sections/[lang]/build/[lang].hbs
./sections/[lang]/build/data.json
./src/content/[lang]/build/[lang].hbs
./src/content/[lang]/build/data.json
```

The `data.json` file has special significance to Assemble, *do not rename this file*.
Expand All @@ -109,11 +106,12 @@ The `data.json` file has special significance to Assemble, *do not rename this f

The main layout is a Handlebars file that the content is injected into and language specific attributes are updated.

The file is `./_layouts/main.hbs`.
The file is `./src/_layouts/main.hbs`.

### Structure of CSS

The CSS files are generated via Compass from the SCSS files located in the SCSS folder, which is run as part of the Grunt task.
The CSS files are generated via LibSass from the SCSS files located in the SCSS folder, which is run as part of the Grunt task.


### Deploy

Expand Down
1 change: 0 additions & 1 deletion _assets/css/src/style.scss

This file was deleted.

Loading

0 comments on commit 2c137e7

Please sign in to comment.