2011-12-30 00:09:51 +01:00
|
|
|
# Setup our load paths
|
|
|
|
libdir = File.expand_path(File.dirname(__FILE__))
|
|
|
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
|
|
|
|
2011-12-30 04:04:39 +01:00
|
|
|
require "middleman-core"
|
|
|
|
|
2011-12-30 00:09:51 +01:00
|
|
|
# Top-level Middleman object
|
|
|
|
module Middleman
|
|
|
|
|
|
|
|
# Custom Renderers
|
|
|
|
module Renderers
|
|
|
|
autoload :Haml, "middleman-more/renderers/haml"
|
|
|
|
autoload :Sass, "middleman-more/renderers/sass"
|
|
|
|
autoload :Markdown, "middleman-more/renderers/markdown"
|
|
|
|
autoload :Liquid, "middleman-more/renderers/liquid"
|
2011-12-30 04:04:39 +01:00
|
|
|
autoload :Slim, "middleman-more/renderers/slim"
|
2011-12-30 00:09:51 +01:00
|
|
|
end
|
|
|
|
|
2012-01-14 21:52:19 +01:00
|
|
|
# Core (automatic) extensions
|
2011-12-30 04:04:39 +01:00
|
|
|
module CoreExtensions
|
2011-12-30 00:09:51 +01:00
|
|
|
# Compass framework for Sass
|
2011-12-30 04:04:39 +01:00
|
|
|
autoload :Compass, "middleman-more/core_extensions/compass"
|
2011-12-30 00:09:51 +01:00
|
|
|
|
|
|
|
# Sprockets 2
|
2011-12-30 04:04:39 +01:00
|
|
|
autoload :Sprockets, "middleman-more/core_extensions/sprockets"
|
|
|
|
end
|
2012-01-14 21:52:19 +01:00
|
|
|
|
2012-03-26 02:38:38 +02:00
|
|
|
# User-activatable extensions
|
2011-12-30 04:04:39 +01:00
|
|
|
module Extensions
|
2011-12-30 00:09:51 +01:00
|
|
|
# RelativeAssets allow any asset path in dynamic templates to be either
|
|
|
|
# relative to the root of the project or use an absolute URL.
|
|
|
|
autoload :RelativeAssets, "middleman-more/extensions/relative_assets"
|
|
|
|
|
|
|
|
# CacheBuster adds a query string to assets in dynamic templates to avoid
|
|
|
|
# browser caches failing to update to your new content.
|
|
|
|
autoload :CacheBuster, "middleman-more/extensions/cache_buster"
|
|
|
|
|
2012-03-05 00:24:38 +01:00
|
|
|
# AssetHash appends a hash of the file contents to the assets filename
|
|
|
|
# to avoid browser caches failing to update to your new content.
|
|
|
|
autoload :AssetHash, "middleman-more/extensions/asset_hash"
|
|
|
|
|
2011-12-30 00:09:51 +01:00
|
|
|
# MinifyCss uses the YUI compressor to shrink CSS files
|
|
|
|
autoload :MinifyCss, "middleman-more/extensions/minify_css"
|
|
|
|
|
|
|
|
# MinifyJavascript uses the YUI compressor to shrink JS files
|
|
|
|
autoload :MinifyJavascript, "middleman-more/extensions/minify_javascript"
|
2012-02-11 05:09:39 +01:00
|
|
|
|
2012-03-13 05:31:05 +01:00
|
|
|
# GZIP assets and pages during build
|
|
|
|
autoload :Gzip, "middleman-more/extensions/gzip"
|
2011-12-30 00:09:51 +01:00
|
|
|
end
|
2011-12-30 04:04:39 +01:00
|
|
|
|
2012-01-14 21:52:19 +01:00
|
|
|
# Setup renderers
|
2011-12-31 23:28:17 +01:00
|
|
|
require "coffee_script"
|
2012-04-14 23:04:10 +02:00
|
|
|
Application.register Middleman::Renderers::Haml
|
|
|
|
Application.register Middleman::Renderers::Sass
|
|
|
|
Application.register Middleman::Renderers::Markdown
|
|
|
|
Application.register Middleman::Renderers::Liquid
|
|
|
|
Application.register Middleman::Renderers::Slim
|
2011-12-30 04:04:39 +01:00
|
|
|
|
|
|
|
# Compass framework
|
2012-04-14 23:04:10 +02:00
|
|
|
Application.register Middleman::CoreExtensions::Compass
|
2011-12-30 04:04:39 +01:00
|
|
|
|
|
|
|
# Sprockets asset handling
|
2012-04-14 23:04:10 +02:00
|
|
|
Application.register Middleman::CoreExtensions::Sprockets
|
2011-12-30 04:04:39 +01:00
|
|
|
|
2011-12-31 23:28:17 +01:00
|
|
|
# Register the optional extensions
|
2011-12-30 04:04:39 +01:00
|
|
|
Extensions.register(:cache_buster) {
|
|
|
|
::Middleman::Extensions::CacheBuster }
|
|
|
|
Extensions.register(:minify_css) {
|
|
|
|
::Middleman::Extensions::MinifyCss }
|
|
|
|
Extensions.register(:minify_javascript) {
|
|
|
|
::Middleman::Extensions::MinifyJavascript }
|
|
|
|
Extensions.register(:relative_assets) {
|
|
|
|
::Middleman::Extensions::RelativeAssets }
|
2012-03-14 06:42:18 +01:00
|
|
|
Extensions.register(:gzip) {
|
|
|
|
::Middleman::Extensions::Gzip }
|
2012-03-05 07:53:43 +01:00
|
|
|
Extensions.register(:asset_hash) {
|
|
|
|
::Middleman::Extensions::AssetHash }
|
2012-02-11 05:09:39 +01:00
|
|
|
end
|