Module: Middleman::More
- Defined in:
- lib/middleman-more.rb
Class Method Summary collapse
-
.registered(app, options = {}) ⇒ Object
Once registered.
Class Method Details
.registered(app, options = {}) ⇒ Object
Once registered
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/middleman-more.rb', line 14 def registered(app, ={}) ### # Setup Core Extensions ### require "middleman-core/templates" require "middleman-more/templates/smacss" # Setup default helpers require "middleman-more/core_extensions/default_helpers" Middleman::Application.register Middleman::CoreExtensions::DefaultHelpers # Setup asset path pipeline require "middleman-more/core_extensions/assets" Middleman::Application.register Middleman::CoreExtensions::Assets # i18n require "i18n" app.after_configuration do # This is for making the tests work - since the tests # don't completely reload middleman, I18n.load_path can get # polluted with paths from other test app directories that don't # exist anymore. ::I18n.load_path.delete_if {|path| path =~ %r{tmp/aruba}} ::I18n.reload! end Middleman::Extensions.register(:i18n) do require "middleman-more/core_extensions/i18n" Middleman::CoreExtensions::Internationalization end # Compass framework require "middleman-more/core_extensions/compass" Middleman::Application.register Middleman::CoreExtensions::Compass ### # Setup Optional Extensions ### # CacheBuster adds a query string to assets in dynamic templates to # avoid browser caches failing to update to your new content. Middleman::Extensions.register(:cache_buster) do require "middleman-more/extensions/cache_buster" Middleman::Extensions::CacheBuster end # MinifyCss compresses CSS Middleman::Extensions.register(:minify_css) do require "middleman-more/extensions/minify_css" Middleman::Extensions::MinifyCss end # MinifyJavascript compresses JS Middleman::Extensions.register(:minify_javascript) do require "middleman-more/extensions/minify_javascript" Middleman::Extensions::MinifyJavascript end # RelativeAssets allow any asset path in dynamic templates to be either # relative to the root of the project or use an absolute URL. Middleman::Extensions.register(:relative_assets) do require "middleman-more/extensions/relative_assets" Middleman::Extensions::RelativeAssets end # GZIP assets and pages during build Middleman::Extensions.register(:gzip) do require "middleman-more/extensions/gzip" Middleman::Extensions::Gzip end # AssetHash appends a hash of the file contents to the assets filename # to avoid browser caches failing to update to your new content. Middleman::Extensions.register(:asset_hash) do require "middleman-more/extensions/asset_hash" Middleman::Extensions::AssetHash end # AssetHost allows you to setup multiple domains to host your static # assets. Calls to asset paths in dynamic templates will then rotate # through each of the asset servers to better spread the load. Middleman::Extensions.register(:asset_host) do require "middleman-more/extensions/asset_host" Middleman::Extensions::AssetHost end # Provide Apache-style index.html files for directories Middleman::Extensions.register(:directory_indexes) do require "middleman-more/extensions/directory_indexes" Middleman::Extensions::DirectoryIndexes end # Lorem provides a handful of helpful prototyping methods to generate # words, paragraphs, fake images, names and email addresses. require "middleman-more/extensions/lorem" Middleman::Application.register Middleman::Extensions::Lorem # AutomaticImageSizes inspects the images used in your dynamic templates # and automatically adds width and height attributes to their HTML # elements. Middleman::Extensions.register(:automatic_image_sizes) do require "middleman-more/extensions/automatic_image_sizes" Middleman::Extensions::AutomaticImageSizes end end |