diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f43afb5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] +# Change these settings to your own preference +indent_style = tab + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[{package.json,npm-shrinkwrap.json,.travis.yml,_config.yml}] +indent_style = space + +[test/expected/*] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..e12d533 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,197 @@ +{ + "env": { + "browser": true, + "node": false + }, + "globals": { + "Modernizr": false, + "jQuery": false + }, + "rules": { + "no-bitwise": 2, + "camelcase": [ + 2, + { + "properties": "never" + } + ], + "curly": [ + 2, + "all" + ], + "eqeqeq": 2, + "guard-for-in": 2, + "no-extend-native": 2, + "wrap-iife": 2, + "indent": [ + 2, + "tab", + { + "SwitchCase": 1 + } + ], + "no-use-before-define": [ + 2, + { + "functions": false + } + ], + "new-cap": 2, + "no-caller": 2, + "no-empty": [ + 2, + { + "allowEmptyCatch": true + } + ], + "no-irregular-whitespace": 2, + "no-new": 2, + "no-plusplus": 0, + "quotes": [ + 2, + "single" + ], + "no-undef": 2, + "no-unused-vars": 2, + "strict": 0, + "max-params": [ + 2, + 6 + ], + "max-depth": [ + 2, + 3 + ], + "max-statements": 0, + "complexity": 0, + "max-len": 0, + "semi": [ + 2, + "always" + ], + "no-cond-assign": 0, + "no-debugger": 0, + "no-eq-null": 0, + "no-eval": 0, + "no-unused-expressions": 0, + "block-scoped-var": 0, + "no-iterator": 0, + "linebreak-style": 0, + "comma-style": [ + 2, + "last" + ], + "no-loop-func": 0, + "no-multi-str": 0, + "require-yield": 0, + "valid-typeof": 0, + "no-proto": 0, + "no-script-url": 0, + "no-shadow": 2, + "dot-notation": 2, + "no-new-func": 0, + "no-new-wrappers": 0, + "no-invalid-this": 0, + "brace-style": [ + 2, + "1tbs", + { + "allowSingleLine": true + } + ], + "no-mixed-spaces-and-tabs": 2, + "no-multiple-empty-lines": 2, + "no-multi-spaces": 2, + "dot-location": [ + 2, + "property" + ], + "operator-linebreak": [ + 2, + "after" + ], + "key-spacing": [ + 2, + { + "beforeColon": false, + "afterColon": true + } + ], + "space-unary-ops": [ + 2, + { + "words": false, + "nonwords": false + } + ], + "space-before-function-paren": [ + 2, + { + "anonymous": "ignore", + "named": "never" + } + ], + "no-spaced-func": 2, + "array-bracket-spacing": [ + 2, + "never", + {} + ], + "space-in-parens": [ + 2, + "never" + ], + "comma-dangle": [ + 2, + "never" + ], + "no-trailing-spaces": 2, + "yoda": [ + 2, + "never" + ], + "eol-last": 2, + "one-var": [ + 2, + "always" + ], + "newline-after-var": [ + 2, + "always" + ], + "lines-around-comment": [ + 2, + { + "beforeLineComment": true + } + ], + "space-infix-ops": 2, + "keyword-spacing": [ + 2, + { + "overrides": { + "else": { + "before": true + }, + "while": { + "before": true + }, + "catch": { + "before": true + }, + "in": { + "before": true + } + } + } + ], + "spaced-comment": [ + 2, + "always" + ], + "space-before-blocks": [ + 2, + "always" + ] + } +} diff --git a/.gitignore b/.gitignore index 44099c7..c6a6c7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,13 @@ .DS_Store _site +dist .sass-cache .brackets.json .jekyll-metadata styles/.sass-cache -styles/.sass-cache/* \ No newline at end of file +styles/.sass-cache/* + +node_modules diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a84947d --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +4.5.0 diff --git a/.travis.yml b/.travis.yml index bc9763b..3c45592 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,26 @@ -language: ruby -rvm: -- 2.3.1 +language: node_js +node_js: + - 4.5.0 before_script: -- chmod +x ./script/cibuild -script: "./script/cibuild" +- chmod +x ./cibuild.sh +script: "./cibuild.sh" env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true + - CXX=g++-4.8 sudo: false -addons: +addons: ssh_known_hosts: $hostname + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 before_install: - openssl aes-256-cbc -K $encrypted_4395499fa958_key -iv $encrypted_4395499fa958_iv -in dash.org-test-web.pem.enc -out dash.org-test-web.pem -d -before_deploy: +- rvm install 2.3.1 +before_deploy: - eval "$(ssh-agent -s)" - chmod 600 $TRAVIS_BUILD_DIR/$IdentityFile - ssh-add $TRAVIS_BUILD_DIR/$IdentityFile @@ -21,5 +28,5 @@ deploy: provider: script skip_cleanup: true script: rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/_dist $user@$hostname:$production_path - on: + on: branch: master diff --git a/Gemfile b/Gemfile index 73302fc..a5f63fc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,6 @@ source 'https://rubygems.org' gem 'jekyll' gem 'jekyll-paginate' -gem 'jekyll-autoprefixer' -gem 'jekyll-serve' gem 'html-proofer' gem 'classifier-reborn' -gem 'jekyll-multiple-languages-plugin', :git => 'https://github.com/perrywoodin/jekyll-multiple-languages-plugin.git' \ No newline at end of file +gem 'jekyll-multiple-languages-plugin', :git => 'https://github.com/perrywoodin/jekyll-multiple-languages-plugin.git' diff --git a/Gemfile.lock b/Gemfile.lock index 8e582bc..56ee0e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,15 +15,12 @@ GEM thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.4.0) - autoprefixer-rails (6.3.7) - execjs classifier-reborn (2.0.4) fast-stemmer (~> 1.0) colorator (1.1.0) colored (1.2) ethon (0.9.0) ffi (>= 1.3.0) - execjs (2.7.0) fast-stemmer (1.0.2) ffi (1.9.14) forwardable-extended (2.6.0) @@ -47,12 +44,9 @@ GEM pathutil (~> 0.9) rouge (~> 1.7) safe_yaml (~> 1.0) - jekyll-autoprefixer (1.0.0) - autoprefixer-rails (~> 6.3.6) jekyll-paginate (1.1.0) jekyll-sass-converter (1.4.0) sass (~> 3.4) - jekyll-serve (1.0.0.rc1) jekyll-watch (1.5.0) listen (~> 3.0, < 3.1) json (1.8.3) @@ -91,10 +85,8 @@ DEPENDENCIES classifier-reborn html-proofer jekyll - jekyll-autoprefixer jekyll-multiple-languages-plugin! jekyll-paginate - jekyll-serve BUNDLED WITH - 1.13.0 + 1.13.1 diff --git a/README.md b/README.md index e9394a9..6954df0 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,18 @@ https://jekyllrb.com ### Requirements (mac) * Ruby: `brew install ruby` * Ruby Gems: https://rubygems.org/pages/download -* NodeJS: https://nodejs.org/en/ +* NodeJS: https://nodejs.org/en/ (Ideally >=4.5.0) * Python: `brew install python` * Bundler: `gem install bundler` -### Supporting Gems -Simply run `bundle install` and [bundler](http://bundler.io/) will install all ruby gems/dependencies. +### Dependencies +(If you have nvm, do `nvm install && nvm use` first.) -CI Note: The Gems must also be installed on the CI server. +Simply run `npm install` to install all dependencies. This will also run `bundle install` on *postinstall* to install all ruby gems. -Mac Note: Bundler will try to install the dependency `nokogiri`. If you are using a Mac, and run into issues related to `nokogiri` during `bundle install`, do the following: +**CI Note**: The Gems must also be installed on the CI server. + +**Mac Note**: Bundler will try to install the dependency `nokogiri`. If you are using a Mac, and run into issues related to `nokogiri` during `bundle install`, do the following: `xcode-select --install` @@ -28,14 +30,16 @@ Then run `bundle install` ### Plugins * `jekyll-multiple-languages-plugin` installed as a gem. Documentation at https://github.com/perrywoodin/jekyll-multiple-languages-plugin. This is a modified fork that adds two new tags for outputting markdown `{% tmd key %}` or `{% translatemd key %}` -## Development -`jekyll serve` Will build to the _site directory whenever a file is changed and serve via 127.0.0.1 +(If you still have a `_plugins/jekyll-multiple-languages-plugin` directory in your root folder, you will need to remove it.) -`jekyll build --watch` Will build to the _site directory whenever a file is changed. +## Development +`npm start` or `npm run watch` to build to the _site directory whenever a file is changed and serve via *localhost:3000* ## Production Build Production builds should be handled by CI. +`npm run build` will build a fully minified, mangled, and compressed build to the _site directory. + Mac xcode-select --install gem install nokogiri diff --git a/_config.yml b/_config.yml index 3272bef..65640c5 100644 --- a/_config.yml +++ b/_config.yml @@ -6,8 +6,12 @@ exclude: - assets/mockups/ - vendor/ - script/ + - src/ + - dist/ + - node_modules/ - Gemfile - Gemfile.lock + - package.json paginate: 5 paginate_path: "/blog/page:num/" name: Dash @@ -17,19 +21,10 @@ description: Digital Cash api: http://www-test.dash.org/api/v1 languages: ["en", "es", "cn", "pt", "ru", "it"] -exclude_from_localizations: ["assets","style-guide"] - -sass: - style: compressed - cache: false - -autoprefixer: - browsers: - - last 2 versions +exclude_from_localizations: ["assets","dist","style-guide"] gems: - jekyll-paginate - - jekyll-autoprefixer - jekyll-multiple-languages-plugin collections: diff --git a/_layouts/default.html b/_layouts/default.html index 4be83b8..c37d612 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -12,7 +12,7 @@ - + @@ -34,9 +34,7 @@ - - - +