1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Wire-up and document smacss template

This commit is contained in:
Thomas Reynolds 2012-08-14 13:47:11 -07:00
parent b3fd8629d3
commit 8e7041994f
3 changed files with 34 additions and 0 deletions

View file

@ -1,6 +1,7 @@
Master
===
* Added SMACSS template
* Give file metadata (such as frontmatter) precedence over path meta. #552
* Add `sass_assets_paths` option for arbitrary sass partial locations.
* Don't catch CoffeeScript errors when in build mode.

View file

@ -16,6 +16,9 @@ module Middleman
# 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

View file

@ -0,0 +1,30 @@
# SMACSS
class Middleman::Templates::Smacss < Middleman::Templates::Base
class_option "css_dir",
:default => "stylesheets",
:desc => 'The path to the css files'
class_option "js_dir",
:default => "javascripts",
:desc => 'The path to the javascript files'
class_option "images_dir",
:default => "images",
:desc => 'The path to the image files'
# Template files are relative to this file
# @return [String]
def self.source_root
File.dirname(__FILE__)
end
# Output the files
# @return [void]
def build_scaffold!
template "shared/config.tt", File.join(location, "config.rb")
directory "smacss/source", File.join(location, "source")
empty_directory File.join(location, "source")
end
end
# Register the template
Middleman::Templates.register(:smacss, Middleman::Templates::Smacss)