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
|
|
|
|
|
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
|
2011-12-30 00:09:51 +01:00
|
|
|
|
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"
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
end
|
2011-12-30 04:04:39 +01:00
|
|
|
|
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 }
|
2011-12-30 00:09:51 +01:00
|
|
|
end
|