Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_site/
node_modules/
_documentcss.com/
gh-pages
Empty file removed .nojekyll
Empty file.
48 changes: 39 additions & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ module.exports = function(grunt){
grunt.loadNpmTasks('documentjs');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-build-control');

grunt.initConfig({
documentjs: {
sites: {
"pages": {
"parent": "home",
"dest": "./",
"dest": "gh-pages",
"glob": {
"pattern": "pages/*.md",
"ignore": "{pages/guides.md,pages/guides/**/*,pages/styles.md}"
Expand All @@ -18,16 +20,16 @@ module.exports = function(grunt){
},
"examples/styles": {
"parent": "Styles",
"dest": "examples/styles",
"dest": "gh-pages/examples/styles",
"glob": {
"pattern": "{pages/styles.md,theme/donejs/static/styles/**/*.{less,css,md}}",
},
},
"templates": "theme/donejs/templates",
"static": "theme/donejs/static"
},
},
"examples/demos": {
"parent": "demos",
"dest": "examples/demos",
"dest": "gh-pages/examples/demos",
"glob": {
"pattern": "{pages/demos/index.md,pages/demos/**/*.md}"
},
Expand All @@ -36,7 +38,7 @@ module.exports = function(grunt){
},
"guides": {
"parent": "guides",
"dest": "docs",
"dest": "gh-pages/docs",
"glob": {
"pattern": "{pages/guides/*.md,pages/guides/**/*.md}"
},
Expand All @@ -45,15 +47,43 @@ module.exports = function(grunt){
}
}
},
copy: {
main: {
expand: true,
src: ['CNAME','theme-*/**'],
dest: 'gh-pages/'
},
},
connect: {
server: {
options: {
livereload: true,
base: 'gh-pages',
open: true,
port: 4000
}
}
}
},
buildcontrol: {
options: {
dir: 'gh-pages',
commit: true,
push: true,
message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
},
pages: {
options: {
remote: '[email protected]:leoj3n/documentcss.git',
branch: 'gh-pages'
}
},
local: {
options: {
remote: '../',
branch: 'build'
}
}
}
});

var sites = grunt.config('documentjs.sites');
Expand Down Expand Up @@ -83,7 +113,7 @@ module.exports = function(grunt){
}
}

grunt.task.run('documentjs');
grunt.task.run('documentjs', 'copy');
});

grunt.registerTask('generate', function(options){
Expand All @@ -98,4 +128,4 @@ module.exports = function(grunt){

grunt.registerTask('default', ['generate:forceBuild']);

}
}
Loading