Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created May 5, 2013 18:23
Show Gist options
  • Select an option

  • Save j-mcnally/5521675 to your computer and use it in GitHub Desktop.

Select an option

Save j-mcnally/5521675 to your computer and use it in GitHub Desktop.
module Middleman
module Emblem
class << self
def registered(app, options={})
require "barber-emblem"
require "middleman-emblem/sprockets-template"
app.after_configuration do
set :emblem_ext, "emblem" if emblem_ext.nil?
set :emblem_dir, "templates" if emblem_ext.nil?
::Sprockets.register_engine ".#{emblem_ext}", Middleman::Emblem::Template
spenv = ::Sprockets::Environment.new(root)
spenv.append_path("#{source_dir}/#{emblem_dir}");
end
end
alias :included :registered
end
end
end
@mrship

mrship commented May 5, 2013

Copy link
Copy Markdown

I have it working with the code altered to:

require "barber-emblem"
require_relative "sprockets-template"

module Middleman
  module Emblem
    class << self
      def registered(app, options={})
        app.after_configuration do
          set :emblem_ext, "emblem" if emblem_ext.nil?
          set :emblem_dir, "emblem_templates" if emblem_ext.nil?
          ::Sprockets.register_engine ".#{emblem_ext}", Middleman::Emblem::Template
        end
      end  
      alias :included :registered
    end
  end
end

Have you checked the resulting application.js to see what the template names are and whether they match what your ember view is expecting?

@mrship

mrship commented May 5, 2013

Copy link
Copy Markdown

What I need to do is to find a way to get the :emblem_dir through to the Middleman::Emblem::Template instance that the Sprockets gem creates...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment