Skip to content

Commit

Permalink
Major restructuring of the generation of the app
Browse files Browse the repository at this point in the history
Removed all the logic behind both choosing what directories CSS, JS etc
ends up and removed the grunt-deploy configuration and options. Will be
added later. All assets now default to assets/css etc and can't be
changed during installation. This fixes #7, fixes #8 and fixes #10.

The updates to index.js includes commenting out the deploy options,
and making Redcarpet the default Markdown engine, removed compass and
removed the h5bp template. This fixes #1, fixes #13, fixes #14,
fixes #15, fixes #16, fixes #17 and fixes #18.
  • Loading branch information
sondr3 committed Jan 28, 2014
1 parent e1eee37 commit d6b7876
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 64 deletions.
10 changes: 5 additions & 5 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ JekyllizeGenerator.prototype.askforOwner = function askforOwner() {
}

// The directories will default to /assets/ for better structure in the app
JekyllizeGenerator.prototype.askForStructure = function askForStructure() {
/*JekyllizeGenerator.prototype.askForStructure = function askForStructure() {
var cb = this.async();
var slashFilter = function (input) {
return input.replace(/^\/*|\/*$/g, '');
Expand Down Expand Up @@ -156,14 +156,14 @@ JekyllizeGenerator.prototype.askForStructure = function askForStructure() {
// Split asset directories on slashes
this.cssExDirectory = props.cssDirectory.split('/').pop();
this.javascriptsExDirectory = props.javascriptDirectory.split('/').pop();
this.imgagesExDirectory = props.imageDirectory.split('/').pop();
this.imagesExDirectory = props.imageDirectory.split('/').pop();
this.fontsExDirectory = props.fontsDirectory.split('/').pop();
cb();
}.bind(this));
};
};*/

JekyllizeGenerator.prototype.askForDeployment = function askForDeployment() {
/*JekyllizeGenerator.prototype.askForDeployment = function askForDeployment() {
var cb = this.async();
var prompts = [{
name: 'deploy',
Expand Down Expand Up @@ -197,7 +197,7 @@ JekyllizeGenerator.prototype.askForDeployment = function askForDeployment() {
cb();
}.bind(this));
};
};*/

JekyllizeGenerator.prototype.askForJekyll = function askForJekyll() {
var cb = this.async();
Expand Down
91 changes: 37 additions & 54 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
'use strict';

// Directory reference:
// css: <%= cssDirectory %>
// javascript: <%= javascriptDirectory %>
// coffeescript: <%= javascriptDirectory %>/_coffee
// images: <%= imageDirectory %>
// fonts: <%= fontsDirectory %>
// css: assets/stylesheets
// sass: assets/_scss
// javascript: assets/javascript
// coffeescript: assets/_coffee
// images: assets/images
// fonts: assets/fonts

module.exports = function (grunt) {
// Show elapsed time after tasks run
Expand All @@ -22,15 +23,15 @@ module.exports = function (grunt) {
},
watch: {
sass: {
files: ['<%%= yeoman.app %>/<%= cssDirectory %>/_scss/**/*.{scss,sass}'],
files: ['<%%= yeoman.app %>/assets/_scss/**/*.{scss,sass}'],
tasks: ['sass:server']
},
autoprefixer: {
files: ['<%%= yeoman.app %>/<%= cssDirectory %>/**/*.css'],
files: ['<%%= yeoman.app %>/assets/**/*.css'],
tasks: ['copy:stageCss', 'autoprefixer:server']
},
coffee: {
files: ['<%%= yeoman.app %>/<%= javascriptDirectory %>/**/*.coffee'],
files: ['<%%= yeoman.app %>/assets/_coffee/**/*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
Expand All @@ -51,10 +52,9 @@ module.exports = function (grunt) {
},
files: [
'.jekyll/**/*.html',
'.tmp/<%= cssDirectory %>/**/*.css',
'{.tmp,<%%= yeoman.app %>}/<%= cssDirectory %>/**/*.css',
'{.tmp,<%%= yeoman.app %>}/<%%= js %>/**/*.js',
'<%%= yeoman.app %>/<%= imageDirectory %>/**/*.{gif,jpg,jpeg,png,svg,webp}'
'{.tmp,<%%= yeoman.app %>}/assets/stylesheets/**/*.css',
'{.tmp,<%%= yeoman.app %>}/assets/javascript/**/*.js',
'<%%= yeoman.app %>/assets/images/**/*.{gif,jpg,jpeg,png,svg,webp}'
]
}
},
Expand Down Expand Up @@ -122,9 +122,9 @@ module.exports = function (grunt) {
dist: {
files: [{
expand: true,
cwd: '<%%= yeoman.app %>/',
cwd: '<%%= yeoman.app %>/assets/_scss',
src: '**/*.{scss,sass}',
dest: '.tmp/<%= cssDirectory %>',
dest: '.tmp/assets/stylesheets',
ext: '.css'
}]
},
Expand All @@ -135,9 +135,9 @@ module.exports = function (grunt) {
},
files: [{
expand: true,
cwd: '<%%= yeoman.app %>/',
cwd: '<%%= yeoman.app %>/assets/_scss',
src: '**/*.{scss,sass}',
dest: '.tmp/<%= cssDirectory %>',
dest: '.tmp/assets/stylesheets',
ext: '.css'
}]
}
Expand All @@ -149,27 +149,27 @@ module.exports = function (grunt) {
dist: {
files: [{
expand: true,
cwd: '<%%= yeoman.dist %>/<%= cssDirectory %>',
cwd: '<%%= yeoman.dist %>/assets/stylesheets',
src: '**/*.css',
dest: '<%%= yeoman.dist %>/<%= cssDirectory %>'
dest: '<%%= yeoman.dist %>/assets/stylesheets'
}]
},
server: {
files: [{
expand: true,
cwd: '.tmp/<%= cssDirectory %>',
cwd: '.tmp/assets/stylesheets',
src: '**/*.css',
dest: '.tmp/<%= cssDirectory %>'
dest: '.tmp/assets/stylesheets'
}]
}
},
coffee: {
dist: {
files: [{
expand: true,
cwd: '<%%= yeoman.app %>/<%= javascriptDirectory %>/_coffee',
cwd: '<%%= yeoman.app %>/assets/_coffee',
src: '**/*.coffee',
dest: '.tmp/<%= javascriptDirectory %>',
dest: '.tmp/assets/javascript',
ext: '.js'
}]
},
Expand Down Expand Up @@ -217,7 +217,7 @@ module.exports = function (grunt) {
assetsDirs: '<%%= yeoman.dist %>',
},
html: ['<%%= yeoman.dist %>/**/*.html'],
css: ['<%%= yeoman.dist %>/<%= cssDirectory %>/**/*.css']
css: ['<%%= yeoman.dist %>/assets/stylesheets/**/*.css']
},
htmlmin: {
dist: {
Expand Down Expand Up @@ -280,8 +280,8 @@ module.exports = function (grunt) {
// Jekyll processes and moves HTML and text files.
// Usemin moves CSS and javascript inside of Usemin blocks.
// Copy moves asset files and directories.
'<%= imageDirectory %>/**/*',
'<%= fontsDirectory %>/**/*',
'assets/images/**/*',
'assets/fonts/**/*',
// Like Jekyll, exclude files & folders prefixed with an underscore.
'!**/_*{,/**}'
// Explicitly add any files your site needs for distribution here
Expand All @@ -297,9 +297,9 @@ module.exports = function (grunt) {
files: [{
expand: true,
dot: true,
cwd: '<%%= yeoman.app %>/<%= cssDirectory %>',
cwd: '<%%= yeoman.app %>/assets/stylesheets',
src: '**/*.css',
dest: '.tmp/<%= cssDirectory %>'
dest: '.tmp/assets/stylesheets'
}]
}
},
Expand All @@ -310,31 +310,21 @@ module.exports = function (grunt) {
dist: {
files: [{
src: [
'<%%= yeoman.dist %>/<%= javascriptDirectory %>/**/*.js',
'<%%= yeoman.dist %>/<%= cssDirectory %>/**/*.css',
'<%%= yeoman.dist %>/<%= imageDirectory %>/**/*.{gif,jpg,jpeg,png,svg,webp}',
'<%%= yeoman.dist %>/<%= fontsDirectory %>/**/*.{eot*,otf,svg,ttf,woff}'
'<%%= yeoman.dist %>/assets/javascript/**/*.js',
'<%%= yeoman.dist %>/assets/stylesheets/**/*.css',
'<%%= yeoman.dist %>/assets/images/**/*.{gif,jpg,jpeg,png,svg,webp}',
'<%%= yeoman.dist %>/assets/fonts/**/*.{eot*,otf,svg,ttf,woff}'
]
}]
}
},<% if (deploy) { %>
buildcontrol: {
dist: {
options: {
remote: '<%= deployRemote %>',
branch: '<%= deployBranch %>',
commit: true,
push: true
}
}
},<% } %>
},
coffeelint: {
options: {
'max_line_length': {
'level': 'ignore'
}
},
check: ['<%%= yeoman.app %>/<%= javascriptDirectory %>/_coffee/*.coffee']
check: ['<%%= yeoman.app %>/assets/_coffee/*.coffee']
},
jshint: {
options: {
Expand All @@ -343,7 +333,7 @@ module.exports = function (grunt) {
},
all: [
'Gruntfile.js',
'<%%= yeoman.app %>/<%= javascriptDirectory %>/**/*.js',
'<%%= yeoman.app %>/assets/javascript/**/*.js',
'test/spec/**/*.js'
]
},
Expand All @@ -358,7 +348,7 @@ module.exports = function (grunt) {
verbose: true
},
check: {
src: ['.tmp/<%= cssDirectory %>/screen.css']
src: ['.tmp/assets/stylesheets/screen.css']
}
},
csslint: {
Expand All @@ -367,7 +357,7 @@ module.exports = function (grunt) {
},
check: {
src: [
'<%%= yeoman.app %>/<%= cssDirectory %>/**/*.css',
'<%%= yeoman.app %>/assets/stylesheets/**/*.css',
]
}
},
Expand Down Expand Up @@ -432,14 +422,7 @@ module.exports = function (grunt) {
'filerev',
'usemin',
'htmlmin'
]);<% if (deploy) { %>

grunt.registerTask('deploy', [
'check',
'test',
'build',
'buildcontrol'
]);<% } %>
]);

grunt.registerTask('default', [
'check',
Expand Down
3 changes: 1 addition & 2 deletions app/templates/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ markdown: redcarpet
pygments: true

# Grunt handles images and assets.
exclude: ['<%= imgagesExDirectory %>', '<%= cssExDirectory %>', '<%= javascriptsExDirectory %>', '<%= fontsExDirectory %>',
'**.png', '**.jpg', '**.jpeg', '**.gif', '**.webp', '**.svg', '**.ico']
exclude: ['assets', '**.png', '**.jpg', '**.jpeg', '**.gif', '**.webp', '**.svg', '**.ico']

include: ['']
6 changes: 3 additions & 3 deletions app/templates/conditional/template/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<!-- build:css({app,.tmp}) /assets/css/main.css -->
<!-- Syntax highlighting CSS -->
<link rel="stylesheet" href="/<%= cssDirectory %>/syntax.css">
<link rel="stylesheet" href="/assets/stylesheets/syntax.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="/<%= cssDirectory %>/main.css">
<link rel="stylesheet" href="/assets/stylesheets/main.css">
<!-- endbuild -->

</head>
Expand Down Expand Up @@ -41,7 +41,7 @@ <h1 class="title"><a href="/">{{ site.name }}</a></h1>
</div>

<!-- build:js({app,.tmp}) /assets/js/app.js -->
<script src="/<%= javascriptDirectory %>/main.js"></script>
<script src="/assets/javascript/main.js"></script>
<!-- endbuild -->
</body>
</html>

0 comments on commit d6b7876

Please sign in to comment.