mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
Adding Grunt tasks for Sass
This commit is contained in:
parent
91b5d27492
commit
2a843c309e
6
.gitignore
vendored
6
.gitignore
vendored
@ -41,10 +41,6 @@ Session.vim
|
||||
.dist
|
||||
.tmp
|
||||
|
||||
|
||||
/core/client/assets/css
|
||||
!/core/client/assets/css/ember-hacks.css
|
||||
/core/client/assets/fonts
|
||||
/core/server/data/export/exported*
|
||||
/docs
|
||||
/_site
|
||||
@ -67,6 +63,8 @@ config.js
|
||||
|
||||
# Built asset files
|
||||
/core/built
|
||||
/core/client/assets/css
|
||||
/core/client/docs/dist/css
|
||||
|
||||
# Coverage reports
|
||||
coverage.html
|
||||
|
@ -30,6 +30,10 @@ core/built/scripts/ghost.js
|
||||
core/built/**/*.map
|
||||
core/client/**
|
||||
!core/client/assets/**
|
||||
core/client/assets/sass/**
|
||||
core/client/assets/css/**
|
||||
!core/client/assets/css/ghost.min.css
|
||||
core/client/docs/**
|
||||
CONTRIBUTING.md
|
||||
SECURITY.md
|
||||
.travis.yml
|
||||
|
78
Gruntfile.js
78
Gruntfile.js
@ -69,11 +69,11 @@ var path = require('path'),
|
||||
files: ['core/client/**/*.js'],
|
||||
tasks: ['clean:tmp', 'transpile', 'concat_sourcemap:dev']
|
||||
},
|
||||
'ghost-ui': {
|
||||
sass: {
|
||||
files: [
|
||||
'bower_components/ghost-ui/dist/css/*.css'
|
||||
'core/client/assets/sass/**/*.scss'
|
||||
],
|
||||
tasks: ['copy:dev']
|
||||
tasks: ['css']
|
||||
},
|
||||
livereload: {
|
||||
files: [
|
||||
@ -142,6 +142,7 @@ var path = require('path'),
|
||||
files: {
|
||||
src: [
|
||||
'core/client/**/*.js',
|
||||
'!core/client/docs/js/*.js',
|
||||
'!core/client/assets/vendor/**/*.js',
|
||||
'!core/client/tpl/**/*.js'
|
||||
]
|
||||
@ -230,16 +231,7 @@ var path = require('path'),
|
||||
stdin: false
|
||||
}
|
||||
},
|
||||
// #### Update Ghost-UI
|
||||
// Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more
|
||||
// information.
|
||||
ghost_ui: {
|
||||
command: path.resolve(cwd + '/node_modules/.bin/bower update ghost-ui --allow-root'),
|
||||
options: {
|
||||
stdout: true,
|
||||
stdin: false
|
||||
}
|
||||
},
|
||||
|
||||
// #### Generate coverage report
|
||||
// See the `grunt test-coverage` task in the section on [Testing](#testing) for more information.
|
||||
coverage: {
|
||||
@ -251,6 +243,36 @@ var path = require('path'),
|
||||
}
|
||||
},
|
||||
|
||||
// ### grunt-sass
|
||||
// compile sass to css
|
||||
sass: {
|
||||
compress: {
|
||||
options: {
|
||||
style: 'compressed',
|
||||
sourceMap: true
|
||||
},
|
||||
files: {
|
||||
'core/client/assets/css/<%= pkg.name %>.min.css': 'core/client/assets/sass/screen.scss',
|
||||
'core/client/docs/dist/css/<%= pkg.name %>.min.css': 'core/client/assets/sass/screen.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// ### grunt-autoprefixer
|
||||
// Autoprefix all the things, for the last 2 versions of major browsers
|
||||
autoprefixer: {
|
||||
options: {
|
||||
silent: true, // suppress logging
|
||||
map: true, // Use and update the sourcemap
|
||||
browsers: ["last 2 versions", "> 1%", "Explorer 10"]
|
||||
},
|
||||
single_file: {
|
||||
src: 'core/client/assets/css/<%= pkg.name %>.min.css',
|
||||
dest: 'core/client/assets/css/<%= pkg.name %>.min.css'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// ### grunt-ember-templates
|
||||
// Compiles handlebar templates for ember
|
||||
emberTemplates: {
|
||||
@ -346,6 +368,12 @@ var path = require('path'),
|
||||
release: {
|
||||
src: ['<%= paths.releaseBuild %>/**']
|
||||
},
|
||||
css: {
|
||||
src: [
|
||||
'core/client/assets/css/**',
|
||||
'core/client/docs/dist/css/**'
|
||||
]
|
||||
},
|
||||
test: {
|
||||
src: ['content/data/ghost-test.db']
|
||||
},
|
||||
@ -363,11 +391,6 @@ 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
|
||||
}, {
|
||||
src: 'core/client/config-dev.js',
|
||||
dest: 'core/client/config.js'
|
||||
@ -379,11 +402,6 @@ 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
|
||||
}, {
|
||||
src: 'core/client/config-prod.js',
|
||||
dest: 'core/client/config.js'
|
||||
@ -395,11 +413,6 @@ 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
|
||||
}, {
|
||||
src: 'core/client/config-prod.js',
|
||||
dest: 'core/client/config.js'
|
||||
@ -846,6 +859,11 @@ var path = require('path'),
|
||||
grunt.registerTask('emberBuildProd', 'Build Ember JS & templates for production',
|
||||
['clean:tmp', 'emberTemplates:prod', 'transpile', 'concat_sourcemap:prod']);
|
||||
|
||||
// ### CSS Build *(Utility Task)*
|
||||
// Build the CSS files from the SCSS files
|
||||
grunt.registerTask('css', 'Build Client CSS',
|
||||
['sass', 'autoprefixer']);
|
||||
|
||||
// ### Init assets
|
||||
// `grunt init` - will run an initial asset build for you
|
||||
//
|
||||
@ -858,7 +876,7 @@ var path = require('path'),
|
||||
// `bower` does have some quirks, such as not running as root. If you have problems please try running
|
||||
// `grunt init --verbose` to see if there are any errors.
|
||||
grunt.registerTask('init', 'Prepare the project for development',
|
||||
['shell:bower', 'shell:ghost_ui', 'update_submodules', 'default']);
|
||||
['shell:bower', 'update_submodules', 'default']);
|
||||
|
||||
// ### Production assets
|
||||
// `grunt prod` - will build the minified assets used in production.
|
||||
@ -873,7 +891,7 @@ var path = require('path'),
|
||||
// Compiles concatenates javascript files for the admin UI into a handful of files instead
|
||||
// of many files, and makes sure the bower dependencies are in the right place.
|
||||
grunt.registerTask('default', 'Build JS & templates for development',
|
||||
['concat:dev', 'copy:dev', 'emberBuildDev']);
|
||||
['concat:dev', 'copy:dev', 'css', 'emberBuildDev']);
|
||||
|
||||
// ### Live reload
|
||||
// `grunt dev` - build assets on the fly whilst developing
|
||||
|
@ -10,7 +10,6 @@
|
||||
"ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#181251821cf513bb58d3e192faa13245a816f75e",
|
||||
"ember-simple-auth": "0.6.4",
|
||||
"fastclick": "1.0.0",
|
||||
"ghost-ui": "~0.9",
|
||||
"handlebars": "1.3.0",
|
||||
"ic-ajax": "1.0.1",
|
||||
"jquery": "1.11.0",
|
||||
@ -21,6 +20,7 @@
|
||||
"loader.js": "git://github.com/stefanpenner/loader.js#1.0.0",
|
||||
"lodash": "2.4.1",
|
||||
"moment": "2.4.0",
|
||||
"normalize-scss": "~3.0.1",
|
||||
"nprogress": "0.1.2",
|
||||
"showdown": "git://github.com/ErisDS/showdown.git#v0.3.2-ghost",
|
||||
"validator-js": "3.4.0",
|
||||
|
@ -10,21 +10,6 @@ source: docs
|
||||
destination: _gh_pages
|
||||
host: 0.0.0.0
|
||||
port: 9001
|
||||
baseurl: /
|
||||
baseurl:
|
||||
url: http://localhost:9001
|
||||
encoding: UTF-8
|
||||
|
||||
# Custom vars
|
||||
current_version: 2.0.0
|
||||
repo: https://github.com/TryGhost/Ghost-UI
|
||||
|
||||
download:
|
||||
source: https://github.com/TryGhost/ghost-ui/releases/
|
||||
dist: https://github.com/TryGhost/ghost-ui/releases/
|
||||
|
||||
blog: http://dev.ghost.org
|
||||
expo: http://dev.ghost.org
|
||||
|
||||
cdn:
|
||||
css: //ghost.org/ghost-ui/0.1.0/css/ghost-ui.min.css
|
||||
js: //ghost.org/ghost-ui/0.1.0/js/ghost-ui.min.js
|
@ -12,7 +12,7 @@
|
||||
// Libraries: Code by Other Homies
|
||||
// --------------------------------------------------
|
||||
|
||||
@import "../bower_components/normalize-scss/_normalize"; // via Bower
|
||||
@import "../../../../bower_components/normalize-scss/_normalize"; // via Bower
|
||||
@import "lib/nprogress";
|
||||
@import "lib/codemirror";
|
||||
|
||||
|
@ -11,11 +11,8 @@
|
||||
</title>
|
||||
|
||||
<!-- Ghost core CSS -->
|
||||
{% if site.github %}
|
||||
<link href="../dist/css/ghost-ui.min.css" rel="stylesheet">
|
||||
{% else %}
|
||||
<link href="../dist/css/ghost-ui.css" rel="stylesheet">
|
||||
{% endif %}
|
||||
<link href="../dist/css/ghost.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<!-- Documentation extras -->
|
||||
{% if site.github %}
|
||||
|
5046
core/client/docs/dist/css/ghost-ui.css
vendored
5046
core/client/docs/dist/css/ghost-ui.css
vendored
File diff suppressed because it is too large
Load Diff
7
core/client/docs/dist/css/ghost-ui.css.map
vendored
7
core/client/docs/dist/css/ghost-ui.css.map
vendored
File diff suppressed because one or more lines are too long
1
core/client/docs/dist/css/ghost-ui.min.css
vendored
1
core/client/docs/dist/css/ghost-ui.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -22,7 +22,7 @@
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,700">
|
||||
<link rel="stylesheet" href="../dist/css/ghost-ui.css" />
|
||||
<link rel="stylesheet" href="../dist/css/ghost.css" />
|
||||
</head>
|
||||
<body class="ember-application settings" data-ember-extension="1">
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
<meta name="msapplication-square310x310logo" content="{{asset "img/large.png" ghost="true"}}" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,700" />
|
||||
<link rel="stylesheet" href="{{asset "css/ghost-ui.min.css" ghost="true"}}" />
|
||||
<link rel="stylesheet" href="{{asset "css/ghost.min.css" ghost="true"}}" />
|
||||
</head>
|
||||
<body class="{{bodyClass}}" data-apps="{{apps}}" data-filestorage="{{file_storage}}" data-blogurl="{{blog_url}}">
|
||||
|
||||
|
@ -74,6 +74,7 @@
|
||||
"bower": "~1.3.5",
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-cli": "~0.1.13",
|
||||
"grunt-autoprefixer": "1.0.1",
|
||||
"grunt-concat-sourcemap": "~0.4.3",
|
||||
"grunt-contrib-clean": "~0.5.0",
|
||||
"grunt-contrib-compress": "~0.5.2",
|
||||
@ -87,6 +88,7 @@
|
||||
"grunt-es6-module-transpiler": "~0.6.0",
|
||||
"grunt-express-server": "~0.4.11",
|
||||
"grunt-mocha-cli": "~1.4.0",
|
||||
"grunt-sass": "~0.14.0",
|
||||
"grunt-shell": "~0.7.0",
|
||||
"grunt-update-submodules": "~0.4.0",
|
||||
"matchdep": "~0.3.0",
|
||||
|
Loading…
Reference in New Issue
Block a user