Skip to content

Instantly share code, notes, and snippets.

Created May 6, 2011 22:39
  • Star 9 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A trivial -> Javascript plugin for 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
def output_ext(ext)
def convert(content)
CoffeeScript.compile content
rescue StandardError => e
puts "CoffeeScript error:" + e.message
Copy link

sukima commented Jun 13, 2012

According to this post on SO OctoPress HTML escapes the output.

This fork fixes that OctoPress issue:

EDIT: The above fork is only needed on older versions of Octopress. Latest works with this gist

Copy link

If you want a more comprehensive asset pipeline solution, you might consider Jekyll Asset Pipeline which will convert CoffeeScript, Sass, Less or any other language via an extension. It can also compress assets via Yahoo's YUI Compressor or Google's Closure Compiler.

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