Browse files

Converted jekyll_ext into a gem (now at version 0.1.0 due to alterati…

…ons to how extensions are loaded)

Close gh-1
  • Loading branch information...
1 parent 19b2834 commit 72af8098c1b3e513907852ead01684000315b674 @rfelix committed Jun 21, 2010
Showing with 31 additions and 21 deletions.
  1. +1 −0 .gitignore
  2. +4 −12 README.textile
  3. +5 −0 Rakefile
  4. +1 −0 VERSION
  5. +2 −2 jekyll → bin/ejekyll
  6. +0 −7 extensions.rb
  7. +18 −0 jekyll_ext.gemspec
  8. 0 {aop → lib}/aop.rb
@@ -0,0 +1 @@
@@ -7,18 +7,10 @@ More information can be found here: "Jekyll Extensions -= Pain":
h2. Installation
-(This was extracted from the blog post "Jekyll Extensions -= Pain":
+<code>gem install jekyll_ext</code>
-# Grab the "jekyll_ext": code from GitHub:
- <code>git clone git://</code>
-# Locate the _lib_ directory in the Jekyll gem installation.
- <code>which jekyll</code> should give you the path to the executable.
- In my case, it displayed <code>/Users/rfelix/.gem/ruby/1.8/bin/jekyll</code>, therefore the _lib_ directory is located at <code>/Users/rfelix/.gem/ruby/1.8/gems/jekyll-0.5.7/lib/</code>
-# Open up the _jekyll_ file in the _jekyll_ext_ directory and edit the constants <code>JEKYLL_LIB</code> and <code>JEKYLL_EXT</code> to contain the paths to the Jekyll gem _lib_ dir and the _jekyll_ext_ dir, respectively.
-# Now you have two options:
-** *symlink the _jekyll_ script* to a path in your PATH environment, but make sure that the path is consulted before the Ruby gems path. You can confirm the right _jekyll_ is being used by issuing <code>jekyll --version</code> which should give you: <code>Jekyll (extended) 0.5.7</code>
-** Or, *replace the _jekyll_ file in the Ruby gems directory* (that you obtained from step 2) with a symlink to the file in <code>jekyll_ext/jekyll</code>.
+Now you just need to create the directory <em>_extensions</em> in your blog where all your extensions will live. Any <em>.rb</em> file in that directory or subdirectory will automatically be loaded by <em>jekyll_ext</em>.
-Now you just need to create the directory <em>_extensions/</em> in your blog and create the file <em>_extensions/jekyll_ext.rb</em> which should load all the extensions that your blog uses.
+IMPORTANT: Instead of using the <code>jekyll</code> command, you should now use <code>ejekyll</code> instead (which is just a jekyll wrapper that loads your extensions).
-You can use my own extensions to help you get started: "my_jekyll_extensions":
+To get you started, take a look at my own <em>_extensions</em> directory: "my_jekyll_extensions":
@@ -0,0 +1,5 @@
+require "rake"
+require "rake/clean"
+require "mg"
@@ -0,0 +1 @@
@@ -5,15 +5,15 @@
require 'rubygems'
require 'jekyll'
-require File.join(File.dirname(__FILE__), 'aop', 'aop.rb')
+require File.join(File.dirname(__FILE__), '..', 'lib', 'aop.rb')
module Jekyll
class << self
alias_method :configuration_without_extensions, :configuration
def configuration_with_extensions(options)
options = configuration_without_extensions(options)
- Dir["_extensions/*.rb"].each do |f|
+ Dir["_extensions/*.rb", "_extensions/*/*.rb"].each do |f|
puts "Loading Extension: #{File.basename(f)}"
load f
@@ -1,7 +0,0 @@
-require File.join(File.dirname(__FILE__), 'aop', 'aop')
-def load_jekyll_extensions(source)
- file = File.join(source, '_extensions', 'jekyll_ext.rb')
- load file
@@ -0,0 +1,18 @@
+# -*- encoding: utf-8 -*-
+ do |spec|
+ = 'jekyll_ext'
+ spec.summary = "Create Jekyll extensions that are local to your blog and that can be shared with others"
+ spec.version = + '/VERSION').strip
+ spec.authors = ['Raoul Felix']
+ = ''
+ spec.description = <<-END
+ jekyll_ext allows you to extend the Jekyll static blog generator without forking
+ and modifying it's codebase. With this code, not only do your extensions live in
+ your blog directory, but they can also be shared and reutilized.
+ spec.executables = ['ejekyll']
+ spec.add_development_dependency('mg')
+ spec.files = Dir['lib/*', 'vendor/*', 'bin/*'] + ['Rakefile', 'README.textile']
+ spec.homepage = ''
File renamed without changes.

0 comments on commit 72af809

Please sign in to comment.