Skip to content

Instantly share code, notes, and snippets.

@juev
Forked from phaer/coffeescript_converter.rb
Created July 28, 2011 05:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juev/1111020 to your computer and use it in GitHub Desktop.
Save juev/1111020 to your computer and use it in GitHub Desktop.
A trivial CoffeeScript.org -> Javascript plugin for jekyll ( https://github.com/mojombo/jekyll ). Put this file in '_plugins/' and write a YAML header to your .coffee files (i.e. "---\n---\n")
module Jekyll
require 'coffee-script'
class CoffeeScriptConverter < Converter
safe true
priority :normal
def matches(ext)
ext =~ /coffee/i
end
def output_ext(ext)
".js"
end
def convert(content)
begin
CoffeeScript.compile content
rescue StandardError => e
puts "CoffeeScript error:" + e.message
end
end
end
end
@matthodan
Copy link

Have you seen/used Jekyll Asset Pipeline?

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