From 125d1ef329555e36b58a944ec75a938f1924f163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 23 Jun 2012 08:30:52 +0200 Subject: [PATCH] apply optimization from yslow --- Gemfile | 2 +- Gemfile.lock | 105 ++--- Rakefile | 2 +- config.rb | 4 +- source/README.md | 388 ------------------ source/_footer.slim | 2 +- source/css/style.css | 293 ------------- source/js/libs/modernizr-2.0.6.min.js | 4 - source/js/libs/modernizr.custom.01860.min.js | 4 + source/layout.slim | 10 +- .../{solarized.scss => solarized.css.scss} | 2 +- 11 files changed, 70 insertions(+), 746 deletions(-) delete mode 100644 source/README.md delete mode 100644 source/css/style.css delete mode 100644 source/js/libs/modernizr-2.0.6.min.js create mode 100644 source/js/libs/modernizr.custom.01860.min.js rename source/stylesheets/{solarized.scss => solarized.css.scss} (94%) diff --git a/Gemfile b/Gemfile index 408b413..78ea304 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "http://rubygems.org" gem "compass", ">= 0.13.alpha.0" -gem "middleman", "~>2.0.15.3" +gem "middleman", ">= 3.0.0.rc.1" gem "middleman-smusher" gem 'compass-960-plugin' diff --git a/Gemfile.lock b/Gemfile.lock index f559f11..7f6e782 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,6 @@ GEM activesupport (3.2.6) i18n (~> 0.6) multi_json (~> 1.0) - addressable (2.2.8) chunky_png (1.2.5) coffee-script (2.2.0) coffee-script-source @@ -16,20 +15,10 @@ GEM sass (~> 3.2.0.alpha.93) compass-960-plugin (0.10.4) compass (>= 0.10.0) - daemons (1.1.8) - em-websocket (0.3.6) - addressable (>= 2.1.1) - eventmachine (>= 0.12.9) - eventmachine (0.12.10) - execjs (1.2.13) + execjs (1.3.2) multi_json (~> 1.0) + ffi (1.0.11) fssm (0.2.9) - guard (0.6.3) - thor (~> 0.14.6) - guard-livereload (0.3.1) - em-websocket (>= 0.2.0) - guard (>= 0.4.0) - multi_json (~> 1.0.3) haml (3.1.6) hike (1.2.1) http_router (0.10.2) @@ -38,34 +27,43 @@ GEM httpclient (2.2.5) i18n (0.6.0) json (1.7.3) + listen (0.4.6) + rb-fchange (~> 0.0.5) + rb-fsevent (~> 0.9.1) + rb-inotify (~> 0.8.8) maruku (0.6.0) syntax (>= 1.0.0) - middleman (2.0.15.3) - coffee-script (~> 2.2.0) - compass (~> 0.11) - execjs (~> 1.2.7) - guard (~> 0.6.2) - haml (~> 3.1.0) - maruku (~> 0.6.0) - middleman-livereload (~> 0.2.0) - padrino-core (~> 0.10.5) - padrino-helpers (~> 0.10.5) - rack (~> 1.3.5) + middleman (3.0.0.rc.1) + middleman-core (= 3.0.0.rc.1) + middleman-more (= 3.0.0.rc.1) + middleman-sprockets (= 3.0.0.rc.1) + middleman-core (3.0.0.rc.1) + activesupport (~> 3.2.4) + bundler (~> 1.1) + listen (~> 0.4.2) + rack (~> 1.4.0) rack-test (~> 0.6.1) - sass (>= 3.1.7) - sinatra (~> 1.3.1) - slim (~> 1.0.2) - sprockets (~> 2.0.3) - thin (~> 1.2.11) - thor (~> 0.14.0) + thor (~> 0.14.3) tilt (~> 1.3.1) - uglifier (~> 1.2) - middleman-livereload (0.2.1) - guard-livereload (~> 0.3.1) - middleman-smusher (0.2.0) - middleman (~> 2.0.2) - smusher (~> 0.4.8) - multi_json (1.0.4) + middleman-more (3.0.0.rc.1) + coffee-script (~> 2.2.0) + coffee-script-source (~> 1.3.3) + compass (>= 0.12.1) + execjs (~> 1.3.2) + haml (>= 3.1.0) + i18n (~> 0.6.0) + maruku (~> 0.6.0) + middleman-core (= 3.0.0.rc.1) + padrino-helpers (~> 0.10.6) + sass (>= 3.1.7) + uglifier (~> 1.2.0) + middleman-smusher (0.0.1) + smusher (~> 0.4.6) + middleman-sprockets (3.0.0.rc.1) + middleman-more (= 3.0.0.rc.1) + sprockets (~> 2.1) + sprockets-sass (~> 0.8.0) + multi_json (1.3.6) oily_png (1.0.2) chunky_png (~> 1.2.1) padrino-core (0.10.6) @@ -77,39 +75,44 @@ GEM padrino-helpers (0.10.6) i18n (~> 0.6) padrino-core (= 0.10.6) - rack (1.3.6) + rack (1.4.1) rack-protection (1.2.0) rack rack-test (0.6.1) rack (>= 1.0) rake (0.9.2.2) - sass (3.2.0.alpha.244) + rb-fchange (0.0.5) + ffi + rb-fsevent (0.9.1) + rb-inotify (0.8.8) + ffi (>= 0.5.0) + sass (3.2.0.alpha.247) sinatra (1.3.2) rack (~> 1.3, >= 1.3.6) rack-protection (~> 1.2) tilt (~> 1.3, >= 1.3.3) - slim (1.0.4) - temple (~> 0.3.4) - tilt (~> 1.3.2) + slim (1.2.2) + temple (~> 0.4.0) + tilt (~> 1.3.3) smusher (0.4.9) httpclient (>= 2.2) json rake - sprockets (2.0.4) + sprockets (2.4.3) hike (~> 1.2) + multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) + sprockets-sass (0.8.0) + sprockets (~> 2.0) + tilt (~> 1.1) syntax (1.0.0) - temple (0.3.5) - thin (1.2.11) - daemons (>= 1.0.9) - eventmachine (>= 0.12.6) - rack (>= 1.0.0) + temple (0.4.0) thor (0.14.6) tilt (1.3.3) - uglifier (1.2.4) + uglifier (1.2.5) execjs (>= 0.3.0) - multi_json (>= 1.0.2) + multi_json (~> 1.3) url_mount (0.2.1) rack @@ -119,7 +122,7 @@ PLATFORMS DEPENDENCIES compass (>= 0.13.alpha.0) compass-960-plugin - middleman (~> 2.0.15.3) + middleman (>= 3.0.0.rc.1) middleman-smusher oily_png rake diff --git a/Rakefile b/Rakefile index e85fdd6..5f7e212 100644 --- a/Rakefile +++ b/Rakefile @@ -12,7 +12,7 @@ task :generate do end desc "Deploy website via rsync" -task :rsync do +task :deploy do exclude = "" if File.exists?('./rsync-exclude') exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'" diff --git a/config.rb b/config.rb index 03b2cfc..efd12c7 100644 --- a/config.rb +++ b/config.rb @@ -92,7 +92,9 @@ configure :build do # Compress PNGs after build # First: gem install middleman-smusher - #activate :smusher + activate :smusher + + activate :gzip # Or use a different image path # set :http_path, "/Content/images/" diff --git a/source/README.md b/source/README.md deleted file mode 100644 index 452c329..0000000 --- a/source/README.md +++ /dev/null @@ -1,388 +0,0 @@ -# HTML5 Boilerplate [http://html5boilerplate.com](http://html5boilerplate.com) - -## Changelog: - -### v.2.0 : August 10th, 2011 - -### v2.0 HIGHLIGHTS - -#### NORMALIZE.CSS - -We are now using [normalize.css](http://github.com/necolas/normalize.css/) developed by Nicolas Gallagher along with Jonathan Neal instead of the traditional CSS Reset stylesheet. - -normalize.css retains useful browser defaults and includes several common fixes to improve cross-browser (desktop and mobile) styling consistency. - -Lots of research has gone into normalize, verifying what are the default user agent styles provided by each browser. We can very specifically change only the ones we need to instead of the bulldozer approach. - -##### Why this is great news: - -* Who likes being so damn redundant and declaring: em, i { font-style: italic; } -* By using normalization instead of a reset + building up default styles, we use less styles and save bytes -* Less noise in your dev tools: when debugging, you don't have to trawl through every reset selector to reach the actual style that is causing the issue. -* More details here: http://necolas.github.com/normalize.css/ - - -#### PROMPT CHROME FRAME FOR IE6 -* With the latest release of Chrome frame which does not require admin access to be installed, we felt it was a good time to prompt IE 6 users to install Chrome Frame. (Using protocol-relative url and exact version for higher expires headers) - - -####BUILD SCRIPT++: Faster, @import inlining, appcache generation -* If 15 seconds was too long to wait before, you'll be happy with the changes. Via a new "intermediate" folder, we cut down build time by 80% or more. -* If you use @imports in your CSS to author in multiple files, the build script will inline all these together. This way, you have a maintainable authoring experience, and still a highly performant production version. -* Making an app that works offline is a badge of honor. Now with a flick of a config switch, the H5BP build script can autogenerate your cache manifest file with all the right info and wire it up. It'll also keep the manifest revved as you deploy new changes. - -##### ADDING RESPOND.JS -* Add respond.js as a shift to a responsive approach. Updated it to improved, comment-free version which would enable IEs to also apply styles using media queries. - - -#### PNGFIX & HANDHELD REMOVED -* Remove handheld.css as we do not think it was useful among the diverse feature phones -* We feel tools like imagealpha and pngquant are more useful than using stopgap fixes like belatedpng. - -### detailed 2.0 changelog - -#### .HTACCESS -* Disable directory browsing by default -* removed trailing slash redirects in htaccess. More: https://github.com/paulirish/html5-boilerplate/wiki/Proper-usage-of-trailing-slash-redirects #493 #515 -* Updating TTF mimetype to fix Google Chrome warning -* Improved support for all versions of Apache, incl workaround for bug in mod_filter: Fixes #441. Fixes #499. Fixes #535. Closes #549. (the grouping ticket) Ref #576 -* Use substring matching in gzip filter_module and re-enable gzip for some common MIME-types -* mod_deflate trigger rules modifications -* Add gzip support for XHTML, RSS, Atom -* Move font & SVG compression from FilesMatch to FilterProvider / AddOutputFilterByType -* Added m4a (Need it for IE9) and m4v (HandBrake default) MIME types. -* moved ETag removal configs closer -* added Header unset ETag In some servers setting "FileETag None" alone, is not enough. Removing header and setting it to None fixes the issue. -* Add `Options +FollowSymlinks` when `RewriteEngine` is used. Fixes #489. -* Some more security for PHP: turn off error display and turn on error logging -* Allow Blackberry to read vCards - - -#### BUILD SCRIPT -* CSSLint, JSLint, JSHint tools are now optionally available in the build script -* New features in build script: -* Added a files.bypass property which when set, will not compress the listed JavaScript files, but just silently passes it on to the publish folder without any change. -* Added a images.bypass with a list of image files or folders within the img directory that you do not want to be optimized. Fixes #564 -* Build script is compatible with php files now. it appears. fixes #392. -* Build script now generates appcache manifest. see #652 -* Test for ant version to head off problems with ant < 1.8.2 -* removes concatenated css files from index.html when they are linked to with link tag. Fixes #452 -* Added DOCTYPE so Eclipse and other IDE's do not complain about the lack of schema. http://stackoverflow.com/questions/363768/disable-dtd-warning-for-ant-scripts-in-eclipse -* Updated Windows optipng and jpegtran paths to include ${basedir} -* Minification affects all .css and .js files in /css and /js dirs, not just the ones explicitly included in concatenation. -* Build script: compress all images in subfolders, too. -* Added gae.js_dir and gae.css_dir so that App Engine projects can have the correct directory names swapped in their templates. -* added a second replace token statement so that "/css/style.css" gets swapped too. -* change *.png and *.jpg to **/*.png and **/*.jpg so that optimize commands reach subdirectories. -* Improved build script compatibility with Netbeans IDE. default.properties: added IDE generated files/folders to exclude from build script .gitignore: Filename case correction for Windows generated Thumb.db Fix #374 -* Adding properties to project.properties so that Google App Engine builds don't have "static" prepended when swapping for minified versions. -* console.log messages are no longer commented out. use log() instead - -* Much faster build process - -Intermediate stages are stored in a new intermediate folder, and only -files that should be published are copied into the publish folder. - -Files are not deleted at the beginning of every build, and files that -have already been processed will not be reprocessed unless the source -has changed. - -* Files are revved by SHA, not incrementally at each build - -Versioned files are referenced by a SHA-1 hash of the content rather -than a build number. This means that changing your HTML and rebuilding -will not cause your users to redownload the same CSS and JavaScript, and -a reverted change may cause users to use a copy that was previously -downloaded. It may be better to use only part of the hash so the HTTP -request is shorter. - -* copy files last This slightly simplifies copying because we don't have to exclude PNG, JPEG, or HTML files from the copy stage. it comes preminified, and we don't need to minify it again This also updates the HTML so that the script is not missing if the unminified scripts are unavailable on the server. This commit requires a change to existing HTML files :/ -* change the source htaccess rather than updating it -* update yuicompressor to 2.4.5. fixes media query minification issue. -* update htmlcompressor to 1.1 which uses the new yuicompressor for CSS. -* try not to re-optimize the same images every time -* Lots of bug fixes for edge cases and improved techniques.. - - - -#### INDEX.HTML -* Use minified jQuery by default. / jQuery updated to 1.6.2 -* Add respond.js as part of shift to 'mobile first' approach. -* Updated to Modernizr 2.0 Complete, Production minified. -* Prompt IE 6 users to install Chrome Frame, update chromeframe install to 1.0.3. Move chromeframe to bottom of page after the other scripts. also reference exact version for higher expires headers. Use protocol-relative url for chrome frame URL Fixes #495 -* Removing touch icon link tags and retaining only the comment. -* Encourage people to send the X-UA-Compatible HTTP header instead of leaving it in the HTML, to avoid edge case issues. Fixes #378. -* Remove the cache-busting query parameters from the HTML. -* Simplify the conditional comment containing code for IE 9+ and modern browsers -* Simpler escape for ``. See http://mathiasbynens.be/notes/etago for more information. -* Encourage people to use a custom Modernizr build containing only the features they need for that particular project. -* Added maximum touch-icon support as per http://mathiasbynens.be/notes/touch-icons#sizes -* Add a link to optional tags that could be added to the element: https://github.com/paulirish/html5-boilerplate/issues/482 -* Standardize the use of single and double quotes as per http://h5bp.com/d/The-markup★quotes -* Added Site Speed tracking for Google Analytics -* Using Modernizr.load/yepnope for loading Google Analytics. Fixes #542 -* Google Analytics now retrieved with Modernizr.load() for byte brevity and optimal speed - -#### STYLE.CSS -* Major: Now using css normalization instead of css reset + building up default styles. Fixes #412, #500, #534. Closes #456. Links #566 -* Add `'oldie'` class to conditional `` classnames. Fix #522 -* Add `img { max-width: 100%; }` to print styles to prevent images from getting cut off. -* Update clearfix to use 'micro' clearfix http://nicolasgallagher.com/micro-clearfix-hack/ -* Add placeholder CSS MQs for mobile-first approach -* Tweaking our hot pink ::selection. It is now #fe57a1, which is Festal (adj): pertaining to or befitting a feast, festival, holiday, or gala occasion. -* Use black for links when printing, refs #147 -* added vertical-align: middle to fix borders on image containers. Fixes #440 -* Add `` overflow fix for IE9. Group `` and `` rules in an 'embedded content' section of CSS file. Add {cursor:pointer} to ` in IE6/7. Avoids numerous layout and whitespace issues that result from setting {overflow:visible} to fix the odd inner spacing of those form elements. -* Add `{resize: vertical}` to `