Permalink
Browse files

Removing jekyll.

Adding nojekyll file so files are not parsed as jekyll.
Adding assemble grunt tasks.
We can also now build the different languages in one command, using jekyll.
Can specify default language and this copies the language file to the index file.
Assemble grunt framework will support handlebars, external data, and in the near future, the Markdown content files
  • Loading branch information...
1 parent 030560c commit c9ae2ec40ebc2a4f17e67611218664a04360f32c @rcherny rcherny committed Nov 8, 2013
View
No changes.
View
@@ -1,85 +1,105 @@
/*global module:false*/
module.exports = function(grunt) {
- var metas = {
- en: {
- path: 'sections/en/',
- files: ['_front_matter.txt', 'general.html', 'markup.html', 'css.html', 'javascript.html', 'performance.html', 'browsers.html', 'seo.html', 'codeReviews.html', 'appendices.html', 'revisionHistory.html']
- }
- }
- function addBasePaths(basePath, fileArray){
- var output = [];
+ 'use strict';
+
+ // @todo: move to json file
+ var standards = {
+ ourLanguages : ['en', 'es'],
+ defaultFile : 'index',
+ defaultExt : '.html',
+ // change this to have the 'index' file be another language
+ defaultLanguage : 'en'
+ };
- fileArray.forEach(function(i){
- output.push(basePath + i);
- grunt.log.write("Including base path: " + basePath + i + '\n');//logging for debugging
- });
-
- return output;
- };
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
- // Task configuration.
- concat: {
- dist: {
- src: ((function(){
- var files = [];
-
- files = addBasePaths(metas.en.path, metas.en.files);
- return files;
+ // clean up after the previous build
+ clean : {
+ build : (function(){
+ var arr = [];
- })()),
- dest: 'index.html'
- }
+ // we iterate over the languages and create our list of output files
+ standards.ourLanguages.forEach(function(val){
+ arr.push(val + standards.defaultExt);
+ });
+
+ // add the default file to the list since it will be replaced by "copy"
+ arr.push(standards.defaultFile + standards.defaultExt);
+
+ return arr;
+ }())
},
+
+ // watch the file system for new changes
watch: {
- options: {
- livereload: true,
- },
css: {
files: ['scss/*.scss'],
tasks: ['compass']
},
html: {
- files: ['sections/en/*.html'],
- tasks: ['concat']
- },
- jekyll: {
- files: ['index.html', '_layouts/*.html'],
- tasks: ['jekyll']
+ files: ['sections/**/*.html', 'sections/**/*.html.md'],
+ tasks: ['default']
}
},
+
compass: {
dist: {
options: {
config: 'config.rb'
}
}
},
- /*todo: setup jekyll build to serve index.html*/
- jekyll: { // Task
- options: { // Universal options
- bundleExec: true,
- config: '_config.yml'
+
+ // combine our files into one file, language by language
+ assemble: {
+ options: {
+ layoutdir: './_layouts',
+ layout: 'main.hbs'
},
- build: {
- options: {
- drafts: false
+ en: {
+ options : {
+ data : 'sections/en/build/data.json',
+ partials: ['sections/en/*.html']
+ },
+ files : {
+ 'en.html' : ['sections/en/build/en.hbs']
+ }
+ },
+ es: {
+ options : {
+ data : 'sections/es/build/data.json',
+ partials: ['sections/es/*.html']
+ },
+ files : {
+ 'es.html' : ['sections/es/build/es.hbs']
}
}
+ },
+
+ // copy the specified default language to the specified file
+ copy : {
+ realeaseLanguage : {
+ src : standards.defaultLanguage + standards.defaultExt,
+ dest : standards.defaultFile + standards.defaultExt
+ }
}
- });
+
+});
// These plugins provide necessary tasks.
- grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-jekyll');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('assemble');
// Default task.
- grunt.registerTask('default', ['concat', 'compass', 'jekyll']);
+ grunt.registerTask('cleanup', ['clean']);
+ grunt.registerTask('default', ['clean', 'compass', 'assemble', 'copy']);
+ grunt.registerTask('watch', ['watch']);
};
View
@@ -1 +0,0 @@
-- # Jekyll configuration file. Currently we are using the defaults so this is empty. -sforst
@@ -6,9 +6,9 @@
<head>
<meta charset="utf-8">
<meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
- <title>{{ page.title }} | Roundarch Isobar</title>
- <meta name="description" content="{{ page.meta.description }}">
- <meta name="keywords" content="{{ page.meta.keywords }}">
+ <title>{{ title }} | Roundarch Isobar</title>
+ <meta name="description" content="{{ meta.description }}">
+ <meta name="keywords" content="{{ meta.keywords }}">
<meta name=viewport content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico"/>
<link rel="apple-touch-icon-precomposed" href="ios-icon.png"/>
@@ -40,7 +40,7 @@ <h1><a id="logo" href="http://www.roundarchisobar.com">Roundarch Isobar</a></h1>
<div id="main" role="document">
-{{content}}
+{{>body}}
</div>
<nav id="side" class="nav-right" role="navigation">
@@ -53,7 +53,7 @@ <h3 class="toc-title">Table of Contents</h3>
<footer role="contentinfo">
<p>
- <span class="float_left">2012 Roundarch Isobar, All rights reserved.</span>
+ <span class="float_left">2013 Roundarch Isobar, All rights reserved.</span>
<span class="float_right">All content licensed under Creative Commons Attribution 3.0 Unported License</span>
</p>
</footer>
Oops, something went wrong.

0 comments on commit c9ae2ec

Please sign in to comment.