From b6101554b21c7636bfc3998ba60bdd021427b1be Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Fri, 20 Nov 2015 15:17:08 -0600 Subject: [PATCH] added gh-pages build instructions, setup icons --- .gitignore | 1 + CONTRIBUTING.md | 34 +++++++++++++++ Gruntfile.js | 43 ++++++++++++++++++- _config.yml | 8 ++++ .../{glyphicons.html => icons.html} | 2 +- package.json | 2 +- 6 files changed, 87 insertions(+), 3 deletions(-) rename docs/_includes/components/{glyphicons.html => icons.html} (98%) diff --git a/.gitignore b/.gitignore index 13183d70..09ae2fa8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ _gh_pages _site docs/.jekyll-metadata +docs/dist *.log .sass-cache diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b0af6e5..cdd95a56 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -217,3 +217,37 @@ Run `grunt build` before committing to ensure your changes follow our coding sta By contributing your code, you agree to license your contribution under the [MIT License](LICENSE). By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](docs/LICENSE). + +## Building documentation + +1. Checkout the master branch from the project root directory + + ```bash + $ git checkout master + ``` + +2. Checkout the `gh-pages` branch in `_gh_pages` directory + + ```bash + $ git clone git@github.com:FezVrasta/bootstrap-material-design.git -b gh-pages _gh_pages + ``` + + **rosskevin only note** when ready kill all files and commit a clean gh-pages directory for a clean start. + + The `_gh_pages` directory is already in `.gitignore` so we are just fine. + +3. Let's test changes to the documentation: + + ```bash + $ jekyll serve + ``` +4. Browse to [http://127.0.0.1:9001/](http://127.0.0.1:9001/) + +5. Push the newly generated site on github: + + ```bash + $ cd _gh_pages + $ git add . + $ git commit -m "First generation" + $ git push + ``` diff --git a/Gruntfile.js b/Gruntfile.js index d509353f..eec1cb96 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,6 +15,7 @@ module.exports = function (grunt) { grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), jqueryCheck: configBridge.config.jqueryCheck.join('\n'), jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'), @@ -37,6 +38,26 @@ module.exports = function (grunt) { } }, + htmlmin: { + dist: { + options: { + collapseWhitespace: true, + conservativeCollapse: true, + minifyCSS: true, + minifyJS: true, + removeAttributeQuotes: true, + removeComments: true + }, + expand: true, + cwd: '_gh_pages', + dest: '_gh_pages', + src: [ + '**/*.html', + '!examples/**/*.html' + ] + } + }, + htmllint: { //options: { // stoponerror: false, @@ -496,6 +517,26 @@ module.exports = function (grunt) { ] } }, + + compress: { + main: { + options: { + archive: 'bootstrap-material-design-<%= pkg.version %>-dist.zip', + mode: 'zip', + level: 9, + pretty: true + }, + files: [ + { + expand: true, + cwd: 'dist/', + src: ['**'], + dest: 'bootstrap-material-design-<%= pkg.version %>-dist' + } + ] + } + }, + exec: { "meteor-init": { command: [ @@ -624,5 +665,5 @@ module.exports = function (grunt) { 'docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-icons-data' ]); - grunt.registerTask('prep-release', ['dist', 'docs', 'jekyll:github', 'htmlmin', 'compress']); + grunt.registerTask('prep-release', ['dist', 'docs', 'jekyll:github', 'htmlmin']); //, 'compress']); }; diff --git a/_config.yml b/_config.yml index b022fada..8ebe24b7 100644 --- a/_config.yml +++ b/_config.yml @@ -1,3 +1,9 @@ +baseurl: "/bootstrap-material-design" +url: "http://fezvrasta.github.io" + +include: + - .nojekyll + # Dependencies markdown: kramdown highlighter: rouge @@ -34,3 +40,5 @@ download: # css_theme_hash: "sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" # js: https://maxcdn.bootstrapcdn.com/bootstrap/0.4.1/js/bootstrap.min.js # js_hash: "sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" + + diff --git a/docs/_includes/components/glyphicons.html b/docs/_includes/components/icons.html similarity index 98% rename from docs/_includes/components/glyphicons.html rename to docs/_includes/components/icons.html index 6edd517a..11bdd61b 100644 --- a/docs/_includes/components/glyphicons.html +++ b/docs/_includes/components/icons.html @@ -2,7 +2,7 @@

Icons

Available icons

-

Includes {{ site.data.icons.length }} in font format.

+

Includes {{ site.data.icons.size }} icons in font format.