From 1b4d698fd900dd521c8d5d69b0766a4ec4ad76d4 Mon Sep 17 00:00:00 2001 From: xavijam Date: Thu, 14 Jan 2016 22:17:06 +0100 Subject: [PATCH] Added gh-pages task --- .grunt/grunt-gh-pages/gh-pages/src | 1 + .styleguide | 4 ++-- Gruntfile.js | 8 +++++--- README.md | 7 ++++++- package.json | 1 + tasks/gh-pages.js | 6 ++++++ 6 files changed, 21 insertions(+), 6 deletions(-) create mode 160000 .grunt/grunt-gh-pages/gh-pages/src create mode 100644 tasks/gh-pages.js diff --git a/.grunt/grunt-gh-pages/gh-pages/src b/.grunt/grunt-gh-pages/gh-pages/src new file mode 160000 index 0000000..6fbdab3 --- /dev/null +++ b/.grunt/grunt-gh-pages/gh-pages/src @@ -0,0 +1 @@ +Subproject commit 6fbdab365c6df53c8e7d8394062e1532f3e87cba diff --git a/.styleguide b/.styleguide index 0f9e8e1..f85e8d7 100644 --- a/.styleguide +++ b/.styleguide @@ -1,7 +1,7 @@ { "sgComment": "SG", - "srcFolder": ".", - "outputFile": "./styleguide/index.html", + "srcFolder": "./src", + "outputFile": "./dist/styleguide/index.html", "templateFile": "./styleguide/_template.html", "themeFile": "./styleguide/theme.css", "highlightFolder": "./node_modules/highlight.js/styles", diff --git a/Gruntfile.js b/Gruntfile.js index 3b321dd..7f2e5c9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,18 +8,19 @@ module.exports = function (grunt) { sass: require('./tasks/sass'), cssmin: require('./tasks/cssmin'), shell: require('./tasks/shell'), - watch: require('./tasks/watch') + watch: require('./tasks/watch'), + 'gh-pages': require('./tasks/gh-pages') }); var baseTasks = [ 'clean', 'sass', 'concat', - 'cssmin' + 'cssmin', + 'shell' ]; var devTasks = baseTasks.concat([ - 'shell', 'connect', 'watch:scss' ]); @@ -31,4 +32,5 @@ module.exports = function (grunt) { grunt.registerTask('dev', devTasks); grunt.registerTask('build', baseTasks); grunt.registerTask('default', baseTasks); + grunt.registerTask('publish', ['gh-pages']); }; diff --git a/README.md b/README.md index a1ba66a..4912a51 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you want to use any of the CartoAssets components, after the installation jus It will generate a UI documentation about the components in this repository: - ```grunt dev``` -### Publish a new version +### Publish a new version in NPM In order to publish a new version of CartoAssets you need to: - Change version of the package. @@ -24,3 +24,8 @@ In order to publish a new version of CartoAssets you need to: If you have these previous steps done: - ```npm publish``` + +### Publish CartoAssets styleguide and documentation in GH-Pages +Just run this command: + +- ```grunt publish``` diff --git a/package.json b/package.json index 9a889ad..4e6c64b 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "grunt-contrib-cssmin": "0.14.0", "grunt-contrib-connect": "0.11.2", "grunt-contrib-watch": "0.6.1", + "grunt-gh-pages": "1.0.0", "grunt-shell": "1.1.2", "load-grunt-tasks": "*" }, diff --git a/tasks/gh-pages.js b/tasks/gh-pages.js new file mode 100644 index 0000000..f3a9470 --- /dev/null +++ b/tasks/gh-pages.js @@ -0,0 +1,6 @@ +module.exports = { + options: { + base: 'dist' + }, + src: '**/*' +};