Skip to content

Commit 2c137e7

Browse files
committed
Merge pull request isobar-us#152 from rcherny/master
This pull request merges master.next into master
2 parents ccae6ac + 2b0b5ba commit 2c137e7

File tree

187 files changed

+9302
-14570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+9302
-14570
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*.err
44
*.orig
55
*.log
6+
*.map
67
*.rej
78
*.swo
89
*.swp

Gemfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

Gemfile.lock

Lines changed: 0 additions & 48 deletions
This file was deleted.

Gruntfile.js

Lines changed: 117 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,50 @@ module.exports = function(grunt) {
55

66
// @todo: move to json file
77
var standards = {
8-
ourLanguages : ['en', 'es', 'nglayout'], // nglayout? just showing my age
8+
ourLanguages : ['en', 'es'],
99
defaultFile : 'index',
1010
defaultExt : '.html',
1111
// change this to have the 'index' file be another language
1212
defaultLanguage : 'en'
1313
};
1414

15+
// output build time stats
16+
require('time-grunt')(grunt);
17+
1518
// Project configuration.
1619
grunt.initConfig({
1720
// Metadata.
1821
pkg: grunt.file.readJSON('package.json'),
1922

23+
// combine our files into one file, language by language
24+
assemble: {
25+
options: {
26+
marked: {
27+
sanitize: false
28+
},
29+
flatten : true,
30+
layout: './src/_layouts/main.hbs'
31+
},
32+
en: {
33+
options : {
34+
data : 'src/content/en/build/data.json'
35+
},
36+
files : {
37+
'en.html' : ['src/content/en/build/en.hbs']
38+
}
39+
},
40+
/*es: {
41+
options : {
42+
data : 'src/content/es/build/data.json'
43+
},
44+
files : {
45+
'es.html' : ['src/content/es/build/es.hbs']
46+
}
47+
},*/
48+
},
49+
2050
// clean up after the previous build
21-
clean : {
51+
clean: {
2252
build : (function(){
2353
var arr = [];
2454

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

3363
return arr;
34-
}())
64+
}()),
65+
assets: ['_assets/**/*']
3566
},
3667

37-
// watch the file system for new changes
38-
watch: {
39-
css: {
40-
files: ['scss/*.scss'],
41-
tasks: ['compass']
68+
// concatenate the js files into one
69+
concat: {
70+
js: {
71+
options: {
72+
separator: ';',
73+
},
74+
files: {
75+
'_assets/js/main.js': ['src/js/**/*.js','!src/js/vendor/jquery-*min.js']
76+
}
4277
}
4378
},
4479

45-
compass: {
46-
dist: {
80+
// connect to the local server
81+
connect: {
82+
server: {
4783
options: {
48-
config: 'config.rb'
84+
port: 8000,
85+
hostname: '127.0.0.1',
86+
keepalive: true
4987
}
5088
}
5189
},
5290

53-
// combine our files into one file, language by language
54-
assemble: {
55-
options: {
56-
marked: {
57-
sanitize: false
58-
},
59-
flatten : true,
60-
layout: './_layouts/main.hbs'
91+
// copy the specified default language to the specified file
92+
copy: {
93+
assets: {
94+
expand: true,
95+
cwd: 'src/js/vendor/',
96+
src: ['jquery*min.js'],
97+
dest: '_assets/js/vendor/'
6198
},
62-
en: {
63-
options : {
64-
data : 'sections/en/build/data.json',
65-
partials: ['sections/en/*.html']
66-
},
67-
files : {
68-
'en.html' : ['sections/en/build/en.hbs']
69-
}
99+
// mat be replaced by imagemin
100+
images: {
101+
expand: true,
102+
cwd: 'src/img',
103+
src: ['**/*.{png,jpg,gif,svg,ico}'],
104+
dest: '_assets/img/'
70105
},
71-
es: {
72-
options : {
73-
data : 'sections/es/build/data.json',
74-
partials: ['sections/es/*.html']
106+
realeaseLanguage : {
107+
src : standards.defaultLanguage + standards.defaultExt,
108+
dest : standards.defaultFile + standards.defaultExt
109+
}
110+
},
111+
112+
// run sass to generate the css
113+
sass: {
114+
global: {
115+
options: {
116+
sourceMap: true,
117+
sourceComments: false,
118+
outputStyle: 'expanded'
75119
},
76-
files : {
77-
'es.html' : ['sections/es/build/es.hbs']
78-
}
79-
},
80-
// this is a new test layout + new content
81-
nglayout: {
82-
options : {
83-
data : 'content/en/build/data.json'
120+
files: [{
121+
expand: true,
122+
cwd: 'src/scss/',
123+
src: ['*.scss', '!js-only.scss'],
124+
dest: '_assets/css/',
125+
ext: '.css'
84126
},
85-
src : 'content/en/build/en.hbs',
86-
dest : 'nglayout.html'
127+
],
128+
}
129+
},
130+
131+
// watch the file system for new changes
132+
watch: {
133+
css: {
134+
files: ['src/scss/**/*.scss'],
135+
tasks: ['sass']
87136
},
137+
html: {
138+
files: ['src/_layouts/**.*', 'src/content/en/**/*.*'],
139+
tasks: ['assemble','copy']
140+
},
141+
img: {
142+
files: ['src/img/**/*.{png,jpg,gif}'],
143+
tasks: ['copy:images'] // may be replaced by imagemin
144+
},
145+
js: {
146+
files: ['src/js/**/*.js'],
147+
tasks: ['concat', 'uglify', 'copy:assets']
148+
}
88149
},
89150

90-
// copy the specified default language to the specified file
91-
copy : {
92-
realeaseLanguage : {
93-
src : standards.defaultLanguage + standards.defaultExt,
94-
dest : standards.defaultFile + standards.defaultExt
151+
// minify the js
152+
uglify: {
153+
target: {
154+
files: {
155+
'_assets/js/main.min.js': ['_assets/js/main.js']
156+
}
95157
}
96158
}
97159

98160
});
99161

100162
// These plugins provide necessary tasks.
101-
grunt.loadNpmTasks('grunt-contrib-compass');
102-
grunt.loadNpmTasks('grunt-contrib-watch');
103-
grunt.loadNpmTasks('grunt-contrib-copy');
163+
grunt.loadNpmTasks('grunt-sass');
104164
grunt.loadNpmTasks('grunt-contrib-clean');
165+
grunt.loadNpmTasks('grunt-contrib-concat');
166+
grunt.loadNpmTasks('grunt-contrib-connect');
167+
grunt.loadNpmTasks('grunt-contrib-copy');
168+
grunt.loadNpmTasks('grunt-contrib-watch');
169+
grunt.loadNpmTasks('grunt-contrib-uglify');
105170
grunt.loadNpmTasks('assemble');
106171

107172
// Default task.
108173
grunt.registerTask('cleanup', ['clean']);
109-
grunt.registerTask('default', ['clean', 'compass', 'assemble', 'copy']);
110-
grunt.registerTask('watch', ['watch']);
174+
grunt.registerTask('server', ['connect']);
175+
grunt.registerTask('default', ['clean', 'sass', 'concat', 'uglify', 'assemble', 'copy']);
176+
grunt.registerTask('dev', ['watch']);
111177

112178
};

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@ All content licensed under Creative Commons Attribution 3.0 Unported License
66

77
## Summary:
88

9-
> **Updated 24 June, 2014**
10-
>
11-
> 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.
12-
>
13-
> Keep a watch on the `master.next` branch.
14-
159
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.
1610

17-
This document's primary motivation is two- fold:
11+
This document's primary motivation is two-fold:
1812

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

2620
## Intent for Build and Content
2721

28-
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.
22+
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.
2923

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

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

4438
### Requirements
4539

46-
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/).
40+
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/).
4741

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

50-
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).
51-
5244
### Build Details
5345

5446
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.
@@ -87,20 +79,25 @@ Finally, the `standards.defaultLanguage` setting determines which `*.html` file
8779
8880
#### Content
8981

82+
The content is written in Markdown files and the build converts it to HTML. Example:
83+
9084
```
91-
./sections/[lang]/*.html
92-
./sections/[lang]/*.md
85+
./src/content/[lang]/css.md
86+
./src/content/[lang]/general.md
87+
./src/content/[lang]/html.md
9388
```
9489

95-
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.
90+
...and so on.
91+
92+
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.
9693

9794
#### Including A Content File
9895

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

10198
```
102-
./sections/[lang]/build/[lang].hbs
103-
./sections/[lang]/build/data.json
99+
./src/content/[lang]/build/[lang].hbs
100+
./src/content/[lang]/build/data.json
104101
```
105102

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

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

112-
The file is `./_layouts/main.hbs`.
109+
The file is `./src/_layouts/main.hbs`.
113110

114111
### Structure of CSS
115112

116-
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.
113+
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.
114+
117115

118116
### Deploy
119117

_assets/css/src/style.scss

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)