Skip to content

Commit

Permalink
Replace SASS with assets from Ghost-UI
Browse files Browse the repository at this point in the history
closes TryGhost#2368
- Remove Ruby dependency (Gemfiles)
- Remove sass/fonts from core/client/assets/
- Add copy task to Gruntfile to copy over ghost-ui assets
- Install Ghost-UI via bower
- Changed .npmignore/.gitignore
- Remove grunt-contrib-sass dependency
- Remove mentions of Ruby in CONTRIBUTING.md
  • Loading branch information
halfdan committed Mar 9, 2014
1 parent c356bbd commit 921ceb7
Show file tree
Hide file tree
Showing 47 changed files with 75 additions and 7,113 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ projectFilesBackup

/core/client/tpl/hbs-tpl.js
/core/client/assets/css
/core/client/assets/fonts
.sass-cache/
/core/client/assets/vendor
/core/client/assets/sass/config.rb
/core/client/assets/sass/layouts/config.rb
/core/client/assets/sass/modules/config.rb
/core/client/assets/sass/modules/bourbon
/core/client/assets/sass/modules/bourbon/*
/core/server/data/export/exported*
/docs
/_site
Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ content/apps/**
!content/apps/README.md
node_modules/**
core/test/**
core/client/assets/sass/**
core/server/data/export/exported*
**/*.db*
*.db*
Expand Down
21 changes: 4 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ developing Ghost.
**Pre-requisites:**

* Node 0.10.x
* Ruby >= 1.9.3
* Bundler Ruby Gem (`gem install bundler`)
* for running functional tests: phantomjs 1.9.x and casperjs 1.1.x
([instructions](https://github.com/TryGhost/Ghost/wiki/Functional-testing-with-PhantomJS-and-CasperJS))
* for building docs: python and pygments
Expand All @@ -197,7 +195,7 @@ developing Ghost.
* If the install fails with errors to do with "node-gyp rebuild" or "SQLite3", follow the SQLite3 install
instructions below this list
* Usually if you're within vagrant, and have installed the guest plugins and updated that, this will not happen
1. Run `grunt init` from the root - this runs bundler, generates the Bourbon directory, compiles SASS and compiles Handlebars templates
1. Run `grunt init` from the root - copies assets and compiles Handlebars templates
1. Run `npm start` from the root to start the server.

If something goes wrong, please see the
Expand All @@ -207,7 +205,7 @@ If something goes wrong, please see the
Whilst developing, you can take advantage of the [Grunt toolkit](https://github.com/TryGhost/Ghost/wiki/Grunt-Toolkit) to automatically compile assets, such as handlebar templates, stylesheets and javascripts. Some useful commands include:
- `grunt dev` => Automatically compile assets in development environment
- `grunt prod` => Automatically compile assets in production environment
- `grunt watch` => Automatically compile sass and handlebars
- `grunt watch` => Automatically compile handlebars

Addresses for development:
- Front-end => <http://localhost:2368>
Expand All @@ -220,8 +218,8 @@ or more of the following:

* `npm install` - fetch any new dependencies
* `git submodule update` - fetch the latest changes to Casper (the default theme)
* `grunt` - will recompile handlebars templates and sass for the admin (as long as you have previously
run `grunt init` to install bourbon)
* `grunt` - will recompile handlebars templates for the admin (as long as you have previously
run `grunt init` to install bower dependencies)
* delete content/data/*.db - delete the database and allow Ghost to recreate the fixtures

### Key Branches & Tags
Expand All @@ -230,12 +228,6 @@ run `grunt init` to install bourbon)
release is here.
- **[gh-pages](http://tryghost.github.io/Ghost)** is The Ghost Guide documentation for Getting Started with Ghost.

### Compiling CSS & JavaScript

A SASS compiler is required to work with the CSS in this project. You can either do this by running `grunt` from
the command line - or by using a 3rd party app. We recommend [CodeKit](http://incident57.com/codekit/) (Paid/Mac)
& [Scout](http://mhs.github.io/scout-app/) (Free/Mac/PC).
You will need to have Ruby installed, as well as having run `gem install sass && gem install bourbon`.

## Grunt Toolkit

Expand All @@ -251,11 +243,6 @@ contributor.
Sounds like you don't have our default theme - Casper, your content/themes/casper folder is probably empty.
When cloning from GitHub be sure to use SSH and to run `git submodule update --init`.

### I get "Syntax error: File to import not found or unreadable: bourbon/_bourbon."

Sounds like you don't have the Ruby gem "bourbon" installed. Make sure you have Ruby, and then
run `gem install bourbon`, and `grunt init`.

### Ghost doesn't do anything - I get a blank screen

Sounds like you probably didn't run the right grunt command for building assets
Expand Down
4 changes: 0 additions & 4 deletions Gemfile

This file was deleted.

15 changes: 0 additions & 15 deletions Gemfile.lock

This file was deleted.

57 changes: 19 additions & 38 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ var path = require('path'),
files: ['core/client/tpl/**/*.hbs'],
tasks: ['handlebars']
},
sass: {
files: ['<%= paths.adminAssets %>/sass/**/*'],
tasks: ['sass:admin']
},
concat: {
files: [
'core/client/*.js',
Expand All @@ -73,8 +69,6 @@ var path = require('path'),
'content/themes/casper/css/*.css',
// Theme JS
'content/themes/casper/js/*.js',
// Admin CSS
'<%= paths.adminAssets %>/css/*.css',
// Admin JS
'core/built/scripts/*.js'
],
Expand Down Expand Up @@ -302,35 +296,10 @@ var path = require('path'),
}
},

// ### Config for grunt-contrib-sass
// Compile all the SASS!
sass: {
admin: {
files: {
'<%= paths.adminAssets %>/css/screen.css': '<%= paths.adminAssets %>/sass/screen.scss'
}
},
compress: {
options: {
style: 'compressed'
},
files: {
'<%= paths.adminAssets %>/css/screen.css': '<%= paths.adminAssets %>/sass/screen.scss'
}
}
},

// ### config for grunt-shell
// command line tools
shell: {
// run bundle
bundle: {
command: 'bundle install'
},
// install bourbon
bourbon: {
command: 'bourbon install --path <%= paths.adminAssets %>/sass/modules/'
},
bower: {
command: path.resolve(__dirname + '/node_modules/.bin/bower install'),
options: {
Expand Down Expand Up @@ -410,6 +379,11 @@ var path = require('path'),
src: 'jquery.js',
dest: 'core/built/public/',
expand: true
}, {
cwd: 'bower_components/ghost-ui/dist/',
src: ['**'],
dest: 'core/client/assets/',
expand: true
}]
},
prod: {
Expand All @@ -418,6 +392,11 @@ var path = require('path'),
src: 'jquery.js',
dest: 'core/built/public/',
expand: true
}, {
cwd: 'bower_components/ghost-ui/dist/',
src: ['**'],
dest: 'core/client/assets/',
expand: true
}]
},
release: {
Expand All @@ -426,6 +405,11 @@ var path = require('path'),
src: 'jquery.js',
dest: 'core/built/public/',
expand: true
}, {
cwd: 'bower_components/ghost-ui/dist/',
src: ['**'],
dest: 'core/client/assets/',
expand: true
}, {
expand: true,
src: buildGlob,
Expand Down Expand Up @@ -864,15 +848,13 @@ var path = require('path'),

grunt.registerTask('release',
'Release task - creates a final built zip\n' +
' - Do our standard build steps (sass, handlebars, etc)\n' +
' - Do our standard build steps (handlebars, etc)\n' +
' - Generate changelog for the past 14 releases\n' +
' - Copy files to release-folder/#/#{version} directory\n' +
' - Clean out unnecessary files (travis, .git*, .af*, .groc*)\n' +
' - Zip files in release-folder to dist-folder/#{version} directory',
[
'shell:bourbon',
'shell:bower',
'sass:compress',
'handlebars',
'concat',
'uglify',
Expand All @@ -884,7 +866,6 @@ var path = require('path'),
grunt.registerTask('dev',
'Dev Mode; watch files and restart server on changes',
[
'sass:admin',
'handlebars',
'concat',
'copy:dev',
Expand Down Expand Up @@ -928,13 +909,13 @@ var path = require('path'),

// ### Tools for building assets

grunt.registerTask('init', 'Prepare the project for development', ['shell:bundle', 'shell:bourbon', 'shell:bower', 'default']);
grunt.registerTask('init', 'Prepare the project for development', ['shell:bower', 'default']);

// Before running in production mode
grunt.registerTask('prod', 'Build CSS, JS & templates for production', ['sass:compress', 'handlebars', 'concat', 'uglify', 'copy:prod']);
grunt.registerTask('prod', 'Build JS & templates for production', ['handlebars', 'concat', 'uglify', 'copy:prod']);

// When you just say 'grunt'
grunt.registerTask('default', 'Build CSS, JS & templates for development', ['update_submodules', 'sass:compress', 'handlebars', 'concat', 'copy:dev']);
grunt.registerTask('default', 'Build JS & templates for development', ['update_submodules', 'handlebars', 'concat', 'copy:dev']);
};

module.exports = configureGrunt;
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"codemirror": "3.15.0",
"Countable": "2.0.2",
"fastclick": "1.0.0",
"ghost-ui": "0.1.0",
"handlebars.js": "1.0.0",
"iCheck": "1.0.1",
"jquery": "1.11.0",
Expand Down
Loading

0 comments on commit 921ceb7

Please sign in to comment.