Commit graph

56 commits

Author SHA1 Message Date
Jonathan Allard 1345ae6e90 I18n: Add support for localized files (fixes #816) 2013-05-02 19:58:23 -07:00
Thomas Reynolds b12a7bff3d Switch AssetHost to be a new-style extension. Setup extensions app scope earlier. Add supports_multiple_instances flag for extensions. 2013-04-20 12:59:14 -07:00
Thomas Reynolds a0445e405a Allow frontmatter renderer_options key to overwrite renderer options on a per-file basis. closes #859 2013-04-11 10:13:36 -07:00
Artem Baguinski cf1f6a0957 test nested partials_dir 2013-04-09 08:46:18 +02:00
Artem Baguinski fe20d92b28 feature for partials_dir setting 2013-04-09 08:46:18 +02:00
Ben Hollis 3e75a10056 Switch default markdown engine to Kramdown 2013-04-06 18:26:41 -07:00
Ben Hollis 17b3e3e628 Include I18n::Fallbacks and set the default I18n locale to our default locale.
Thus, when a translation is missing in the current locale, fall back to the default locale. See https://github.com/svenfuchs/i18n/wiki/Fallbacks for more info and configuration settings available to users.

Also, this change adds a "t" helper that proxies to I18n.t, just like Rails, for more concise translating.
2013-04-06 18:07:09 -07:00
Ben Hollis 044b49d83b Fixes for alpha Sass versions 2013-04-04 23:28:28 -07:00
Steven Sloan 6043392e1a add feature tests for markdown support in haml 2013-04-04 15:16:01 -04:00
Ben Hollis 4d5c509688 Fix several issues around i18n and resource metadata.
There are a few things changing here. One is that we always dup metadata before using it - this prevents a class of nasty bugs where after the first resource list build, blocks had been deleted from metadata hashes, meaning they would no longer be applied. Now they will always stick around. Then, I made sure that whenever we render a file, we save the previous I18n.locale and restore it afterwards, in case people change locale from blocks. This should help in some weird cases where files are rendered recursively. Finally, I've added a :lang option that can be used from "page" or "proxy" to allow people to specify the language for one or more files without having to pass a block that sets I18n.locale directly, which should make that pattern much cleaner. This fixes #809 and may also fix middleman/middleman-blog#106.
2013-04-03 00:07:31 -07:00
Ben Hollis 9057b7a85e Support Haml 4. Tests only run with Haml 4 now. Fixes #783 2013-02-17 19:40:17 -08:00
Steven Sloan 17ad2caf11 also "build" .htpasswd files 2013-01-21 11:21:48 -08:00
Thomas Reynolds c7e35b95ba use .sass-cache everywhere 2013-01-13 15:22:36 -08:00
Thomas Reynolds 01e9c336b0 Stylus support and tests. Fixes #649 2012-10-28 12:18:29 -07:00
Adam Luikart 4076666c19 Add test for asset_hashing rack-filtered items. 2012-09-11 00:08:57 -07:00
Thomas Reynolds 05834ad386 Test relative_assets with i18n 2012-09-02 10:04:43 -07:00
Thomas Reynolds 1998668a87 Disable buggy color-compression in built-in Rainpress CSS minification. Fixes #576 2012-08-28 16:08:34 -07:00
Thomas Reynolds 446aa6a4ba Clean up whitespace, play with cane for testing style quality and code complexity 2012-08-13 15:41:07 -07:00
Thomas Reynolds f1eae1e0c8 Correct path in sass-assets-path test 2012-07-25 12:05:43 -07:00
Ben Hollis e6c7caaa83 Test for Redcarpet using our link_to and image_tag helpers 2012-07-18 22:57:52 -07:00
kematzy 3ea2241155 Added :sass_assets_path for external SASS repositories
Compass is great, but sometimes we need to have common framework code in one (global) location with local overrides in the app.

This addition adds built-in support for loading SASS/SCSS files from multiple locations external to the "source" directory and even the Middleman app root.

Example usage:

    # in config.rb

    set :sass_assets_path, [ "#{root}/assets/sass/", "~/.sass-repo/"]

Using symlinks or copying files to the Middleman project can get messy quickly.  This fix reduces some of those issues.
2012-07-17 09:21:46 -07:00
kematzy c00f9d5782 Tests for :sass_cache_path custom config
First time working with Cucumber, so perhaps not the best way to do things.

* Tests for default setting which stores the .sass_cache directory in Middleman app root.

* Tests for custom setting which stores the .sass_cache directory in /tmp directory.

Please Note!  Unable to test the output of the default .sass_cache location since the directory is stored outside of the app root during testing, but inside app root in "production"
2012-07-16 14:39:26 +08:00
Thomas Reynolds 63224639d9 Add tests for more implied extensions 2012-07-04 16:45:27 -07:00
Ben Hollis 6ac263619a Make :http_prefix work in link_to and asset helpers as long as the linked item is a sitemap resource. Fixes #484. 2012-06-23 17:19:24 -07:00
Thomas Reynolds 286c7352b6 Fix Less load paths, simplify builder error output. Fixes #461 2012-06-05 10:24:00 -07:00
Thomas Reynolds e26b68635f Haml wrap_layout passes again 2012-06-02 14:19:45 -07:00
Ben Hollis efa846341d Update nested_layout tests to show that Haml still doesn't work right. Also updated Slim and ERb tests to verify ordering of output. 2012-06-02 00:35:03 -07:00
Ben Hollis f287e0a2bc Don't asset_hash ico and manifest. Now with tests to prevent another regression. 2012-06-01 23:54:57 -07:00
Thomas Reynolds 2ab294c602 Fix wrap_layout for all know templating engines. Fixes #417 2012-06-01 20:08:28 -07:00
Thomas Reynolds 98fc81beef Implement and test asset_hash ignore option 2012-05-26 15:08:59 -07:00
Thomas Reynolds 8d483f882c Move Sprockets into an extension 2012-05-26 13:43:27 -07:00
Thomas Reynolds 64f84bacd2 asset urls, padrino helpers and i18n belong in more 2012-05-24 16:31:21 -07:00
Thomas Reynolds 1cad726c81 Move off-by-default extensions into middleman-more, make middleman-more itself an extension 2012-05-24 16:14:17 -07:00
Thomas Reynolds f0d781cce3 Implement our own Redcarpet Template to support renderer-level options. Closes #442 2012-05-22 14:50:37 -07:00
Thomas Reynolds a7adc20b47 still support and test redcarpet 2012-05-02 15:27:47 -07:00
Thomas Reynolds b1d6b94302 Fixture-less slim 2012-04-26 16:21:53 -07:00
Thomas Reynolds 2e68e09200 Fixture-less ignored_already_minified 2012-04-26 16:20:03 -07:00
Thomas Reynolds 240f67410d Use config.rb file contents in minify test cases instead of fixtures 2012-04-26 14:07:10 -07:00
Thomas Reynolds dc784edc66 test directory_index and relative_assets combo 2012-04-16 16:52:21 -07:00
Ben Hollis 192047d242 Minify all JS and CSS via middleware. This means JS or CSS anywhere in the site is minified, not just in the Sprockets-controlled directories. I've also added inline CSS compression, and handling of several common "guards" that get wrapped around JS. Also, leave alone non-JS script tags (which may contain something like jQuery templates). Sprockets no longer has anything to do with minification after this. 2012-04-09 00:05:22 -07:00
Ben Hollis fc79459e61 Fix the asset_hash extension to operate on the hash of the rendered output rather than just the source file. This prevents generating the same hash for a file when partials it uses change, or if a helper it uses produces different output. As part of this change I removed the caching from Sitemap::Page#destination_path and asset_hash since they were preventing recalculation of path/hash when partials changed, and I rewrote the Sprockets extension to expose the Sprockets environment to other extension, which included consolidating the JS and CSS Sprockets environments into one. 2012-04-04 00:00:33 -07:00
Ben Hollis 0a97aa7ec3 Fix undefined variable error in cache_buster, and make its tests more explicit. 2012-04-01 18:25:57 -07:00
Ben Hollis c27a288f1a Tests for using asset_host with asset_hash 2012-04-01 18:05:20 -07:00
Ben Hollis 317dfb318a Rename gzip_assets to just gzip since it does HTML too 2012-03-12 21:31:05 -07:00
Thomas Reynolds b9475bbccc Merge asset_hash extension 2012-03-04 22:53:43 -08:00
Ben Hollis 073086b79c Extension to add hash values to asset filenames. This extension causes asset file types (images, scripts, stylesheets, etc) to have a unique identifier appended to their filename that consists of a hash of their contents. This extension also includes a Rack middleware that rewrites references to these assets in HTML, JavaScript, and CSS files, eliminating the need to use special helper functions to include modified filenames in references. 2012-03-04 15:24:38 -08:00
Ben Hollis 81c83fafa6 Merge remote-tracking branch 'origin/master' 2012-02-23 21:33:05 -08:00
Vasily Fedoseyev 7458acae4d add test for vendored js 2012-02-17 03:22:48 +04:00
Ben Hollis c9b7bf4b59 Extension that will pre-Gzip JS and CSS files. Gzipped assets can be served directly by Apache or Nginx with the proper configuration, and pre-zipping means that we can use a more agressive compression level at no CPU cost per request. 2012-02-10 21:06:44 -08:00
Thomas Reynolds 79eeba9d1a switch built-in css compressor 2012-02-08 08:47:34 -08:00