diff --git a/Gruntfile.js b/Gruntfile.js index 6107ecafd7..5ba7ca8bd5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,7 +9,10 @@ module.exports = function (grunt) { RegExp.quote = function (string) { return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&') } + + var fs = require('fs') var btoa = require('btoa') + // Project configuration. grunt.initConfig({ @@ -41,7 +44,7 @@ module.exports = function (grunt) { src: ['js/tests/unit/*.js'] }, assets: { - src: ['docs-assets/js/application.js', 'docs-assets/js/customizer.js'] + src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js'] } }, @@ -62,12 +65,12 @@ module.exports = function (grunt) { csslint: { options: { - csslintrc: '.csslintrc' + csslintrc: 'less/.csslintrc' }, src: [ 'dist/css/bootstrap.css', 'dist/css/bootstrap-theme.css', - 'docs-assets/css/docs.css' + 'docs/assets/css/docs.css' ] }, @@ -115,13 +118,13 @@ module.exports = function (grunt) { report: 'min' }, src: [ - 'docs-assets/js/less.js', - 'docs-assets/js/jszip.js', - 'docs-assets/js/uglify.js', - 'docs-assets/js/filesaver.js', - 'docs-assets/js/customizer.js' + 'docs/assets/js/less.js', + 'docs/assets/js/jszip.js', + 'docs/assets/js/uglify.js', + 'docs/assets/js/filesaver.js', + 'docs/assets/js/customizer.js' ], - dest: 'docs-assets/js/customize.js' + dest: 'docs/assets/js/customize.js' } }, @@ -182,7 +185,7 @@ module.exports = function (grunt) { csscomb: { sort: { options: { - sortOrder: '.csscomb.json' + config: 'less/.csscomb.json' }, files: { 'dist/css/<%= pkg.name %>.css': ['dist/css/<%= pkg.name %>.css'], @@ -196,6 +199,16 @@ module.exports = function (grunt) { expand: true, src: ['fonts/*'], dest: 'dist/' + }, + docs: { + expand: true, + cwd: './dist', + src: [ + '{css,js}/*.min.*', + '{css}/*.map', + 'fonts/*' + ], + dest: 'docs/dist' } }, @@ -267,7 +280,7 @@ module.exports = function (grunt) { build: process.env.TRAVIS_JOB_ID, concurrency: 3, urls: ['http://127.0.0.1:3000/js/tests/index.html'], - browsers: grunt.file.readYAML('sauce_browsers.yml') + browsers: grunt.file.readYAML('test-infra/sauce_browsers.yml') } } } @@ -306,10 +319,10 @@ module.exports = function (grunt) { grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']); // Fonts distribution task. - grunt.registerTask('dist-fonts', ['copy']); + grunt.registerTask('dist-docs', ['copy:docs']); // Full distribution task. - grunt.registerTask('dist', ['clean', 'dist-css', 'dist-fonts', 'dist-js']); + grunt.registerTask('dist', ['clean', 'dist-css', 'copy:fonts', 'dist-js']); // Default task. grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data', 'build-customizer']); @@ -320,8 +333,6 @@ module.exports = function (grunt) { grunt.registerTask('change-version-number', ['sed']); grunt.registerTask('build-glyphicons-data', function () { - var fs = require('fs') - // Pass encoding, utf8, so `readFileSync` will return a string instead of a // buffer var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8') @@ -340,15 +351,13 @@ module.exports = function (grunt) { } // Create the `_data` directory if it doesn't already exist - if (!fs.existsSync('_data')) fs.mkdirSync('_data') + if (!fs.existsSync('docs/_data')) fs.mkdirSync('docs/_data') - fs.writeFileSync('_data/glyphicons.yml', glyphiconsData) + fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData) }); // task for building customizer grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () { - var fs = require('fs') - function getFiles(type) { var files = {} fs.readdirSync(type) @@ -363,6 +372,6 @@ module.exports = function (grunt) { } var files = getFiles('js') + getFiles('less') + getFiles('fonts') - fs.writeFileSync('docs-assets/js/raw-files.js', files) + fs.writeFileSync('docs/assets/js/raw-files.js', files) }); }; diff --git a/_config.yml b/_config.yml index ae7b5a1e6f..e4d64c79f4 100644 --- a/_config.yml +++ b/_config.yml @@ -6,37 +6,27 @@ pygments: true permalink: pretty # Server +source: ./docs destination: ./_gh_pages +host: 0.0.0.0 port: 9001 -exclude: -- ".editorconfig" -- ".gitignore" -- "bower.json" -- "CNAME" -- "composer.json" -- "CONTRIBUTING.md" -- "DOCS-LICENSE" -- "Gruntfile.js" -- "less" -- "LICENSE" -- "node_modules" -- "package.json" -- "README.md" -- "sauce_browsers.yml" -- "test-infra" +baseurl: / +url: http://localhost:9001 # Custom vars current_version: 3.0.3 repo: https://github.com/twbs/bootstrap -download_source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip -download_dist: https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip -download_sass: https://github.com/twbs/bootstrap-sass/archive/v3.0.3.0.tar.gz +download: + source: https://github.com/twbs/bootstrap/archive/v3.0.3.zip + dist: https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip + sass: https://github.com/twbs/bootstrap-sass/archive/v3.0.3.0.tar.gz blog: http://blog.getbootstrap.com expo: http://expo.getbootstrap.com sass_repo: https://github.com/twbs/bootstrap-sass -cdn_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css -cdn_theme_css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css -cdn_js: //netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js +cdn: + css: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css + css_theme: //netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css + js: //netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index e1a7a7d0d4..6cbb2ea1aa 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -351,7 +351,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" $next = this.$element.find('.item')[fallback]() } - if ($next.hasClass('active')) return + if ($next.hasClass('active')) return this.sliding = false var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) this.$element.trigger(e) @@ -659,13 +659,14 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" $(' -

The less/, js/, and fonts/ are the source code for our CSS, JS, and icon fonts (respectively). The dist/ folder includes everything listed in the precompiled download section above. docs-assets/, examples/, and all *.html files are for our documentation. Beyond that, any other included file provides support for packages, license information, and development.

+

The less/, js/, and fonts/ are the source code for our CSS, JS, and icon fonts (respectively). The dist/ folder includes everything listed in the precompiled download section above. docs/assets/, examples/, and all *.html files are for our documentation. Beyond that, any other included file provides support for packages, license information, and development.