Go to file
Nick Fagerlund 9ca7f70d70 Fix 'undefined method `encoding` for "mailto"' errors w/ Ruby 1.8 and Kramdown > 0.14.0
When using Ruby 1.8.7 and Kramdown 0.14.0 and newer, the following build error
would occur if any page in your site contained a `<name@example.com>` email
address link:

Generating...   Conversion error: There was an error converting 'contribute.markdown'.
/Users/nick/Documents/puppet-docs/vendor/bundle/ruby/1.8/gems/kramdown-1.0.2/lib/kramdown/converter/html.rb:404:in `obfuscate': undefined method `encoding' for "mailto":String (NoMethodError)

See also:
http://rubyforge.org/tracker/index.php?func=detail&aid=29750&group_id=7403&atid=28673

This problem traced back to the following line in the Kramdown source:

result.force_encoding(text.encoding) if result.respond_to?(:force_encoding)

Strings aren't supposed to respond to the :force_encoding method in Ruby < 1.9,
but lib/jekyll/core_ext.rb was modifying the string class like so:

def force_encoding(enc)
  self
end

Strings still won't respond to :encoding, though, so we get an error when
Kramdown tries to read the incoming encoding and everything will blow up.

An ack of the codebase suggests that this was only added so we could force an
encoding for rdiscount on 1.9 without having to check whether we were running
under 1.8. Since testing for said method to learn whether one is running under a
1.9-like encoding regime seems to be a thing in libraries we rely on, we
shouldn't insert this dummy method without also dummying every other part of the
Ruby 1.9+ encoding system.

This commit removes the dummy :force_encoding method to stop poisoning core
classes for libraries we use, and moves the adjustment for 1.9-like encoding
regimes to the one place where it's needed.
2013-08-07 20:07:54 -07:00
bin Add -D short-form switch for drafts 2013-08-07 16:01:21 -05:00
features s/sitej/site/ props @benbalter 2013-07-22 14:57:44 +02:00
lib Fix 'undefined method `encoding` for "mailto"' errors w/ Ruby 1.8 and Kramdown > 0.14.0 2013-08-07 20:07:54 -07:00
script Add a bootstrap script 2013-01-22 23:10:51 +00:00
site It's WordPress - capital P, dang it. 2013-08-06 18:44:20 +02:00
test Add test for Configuration#fix_common_issues 2013-08-06 21:22:08 +02:00
.gitignore ignore .ruby-version 2013-03-13 18:47:07 +00:00
.travis.yml Remove duplicate period in travis message. 2013-07-01 17:41:11 +02:00
CONTRIBUTING.markdown Standardized all text files on markdown and set all their extensions to the shortform 2013-07-06 13:51:33 -04:00
Gemfile Explicitly require HTTPS rubygems source 2013-02-27 20:28:09 -05:00
History.markdown Update history to reflect merge of #1390 2013-08-08 00:29:34 +02:00
LICENSE convert to use rakegem 2010-04-21 13:55:01 -07:00
README.markdown Update dependencies in README 2013-07-28 22:25:22 +02:00
Rakefile Cleaned up code that generates History command. 2013-06-08 17:20:41 +02:00
cucumber.yml Change default format to pretty and create travis profile 2013-03-04 03:12:31 +01:00
jekyll.gemspec Release 1.1.2 2013-07-25 09:15:34 +02:00

README.markdown

Jekyll

Build Status Code Climate

By Tom Preston-Werner, Nick Quaranto, and many awesome contributors!

Jekyll is a simple, blog aware, static site generator. It takes a template directory (representing the raw form of a website), runs it through Textile or Markdown and Liquid converters, and spits out a complete, static website suitable for serving with Apache or your favorite web server. This is also the engine behind GitHub Pages, which you can use to host your project's page or blog right here from GitHub.

Getting Started

Diving In

Runtime Dependencies

  • Commander: Command-line interface constructor (Ruby)
  • Colorator: Colorizes command line output (Ruby)
  • Classifier: Generating related posts (Ruby)
  • Directory Watcher: Auto-regeneration of sites (Ruby)
  • Kramdown: Markdown-superset converter (Ruby)
  • Liquid: Templating system (Ruby)
  • Maruku: Default markdown engine (Ruby)
  • Pygments.rb: Syntax highlighting (Ruby/Python)
  • RedCarpet: Markdown engine (Ruby)
  • Safe YAML: YAML Parser built for security (Ruby)

Developer Dependencies

  • Launchy: Cross-platform file launcher (Ruby)
  • RDiscount: Discount Markdown Processor (Ruby)
  • RedCloth: Textile support (Ruby)
  • RedGreen: Nicer test output (Ruby)
  • RR: Mocking (Ruby)
  • Shoulda: Test framework (Ruby)
  • SimpleCov: Coverage framework (Ruby)

License

See LICENSE.