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
|
|
|
|
|
|
|
# User-activatable extendions
|
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
|
|
|
|
|
|
|
# GZIP assets during build
|
|
|
|
autoload :GzipAssets, "middleman-more/extensions/gzip_assets"
|
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"
|
2011-12-30 04:04:39 +01:00
|
|
|
Base.register Middleman::Renderers::Haml
|
|
|
|
Base.register Middleman::Renderers::Sass
|
|
|
|
Base.register Middleman::Renderers::Markdown
|
|
|
|
Base.register Middleman::Renderers::Liquid
|
|
|
|
Base.register Middleman::Renderers::Slim
|
|
|
|
|
|
|
|
# Compass framework
|
|
|
|
Base.register Middleman::CoreExtensions::Compass
|
|
|
|
|
|
|
|
# Sprockets asset handling
|
|
|
|
Base.register Middleman::CoreExtensions::Sprockets
|
|
|
|
|
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-02-11 05:09:39 +01:00
|
|
|
Extensions.register(:gzip_assets) {
|
|
|
|
::Middleman::Extensions::GzipAssets }
|
2012-03-05 07:53:43 +01:00
|
|
|
Extensions.register(:asset_hash) {
|
|
|
|
::Middleman::Extensions::AssetHash }
|
2012-02-11 05:09:39 +01:00
|
|
|
end
|