Module: Jekyll
- Defined in:
- lib/jekyll/convertible.rb,
lib/jekyll.rb,
lib/jekyll/page.rb,
lib/jekyll/post.rb,
lib/jekyll/site.rb,
lib/jekyll/pager.rb,
lib/jekyll/layout.rb,
lib/jekyll/filters.rb,
lib/jekyll/static_file.rb,
lib/jekyll/haml_helpers.rb,
lib/jekyll/tags/include.rb,
lib/jekyll/converters/mt.rb,
lib/jekyll/converters/csv.rb,
lib/jekyll/tags/highlight.rb,
lib/jekyll/converters/typo.rb,
lib/jekyll/converters/mephisto.rb,
lib/jekyll/converters/wordpress.rb,
lib/jekyll/converters/textpattern.rb
Overview
NOTE: This converter requires Sequel and the MySQL gems. The MySQL gem can be difficult to install on OS X. Once you have MySQL installed, running the following commands should work: $ sudo gem install sequel $ sudo gem install mysql – –with-mysql-config=/usr/local/mysql/bin/mysql_config
Defined Under Namespace
Modules: CSV, Convertible, Filters, HamlHelpers, MT, Mephisto, TextPattern, Typo, WordPress Classes: HighlightBlock, IncludeTag, Layout, Page, Pager, Post, Site, StaticFile
Constant Summary collapse
- DEFAULTS =
Default options. Overriden by values in _config.yml or command-line opts. Strings are used instead of symbols for YAML compatibility.
{ 'auto' => false, 'server' => false, 'server_port' => 4000, 'source' => '.', 'destination' => File.join('.', '_site'), 'lsi' => false, 'pygments' => false, 'sass' => false, 'markdown' => 'maruku', 'permalink' => 'date', 'maruku' => { 'use_tex' => false, 'use_divs' => false, 'png_engine' => 'blahtex', 'png_dir' => 'images/latex', 'png_url' => '/images/latex' } }
Class Method Summary collapse
-
.configuration(override) ⇒ Object
Generate a Jekyll configuration Hash by merging the default options with anything in _config.yml, and adding the given options on top
override
is a Hash of config directives. - .version ⇒ Object
Class Method Details
.configuration(override) ⇒ Object
Generate a Jekyll configuration Hash by merging the default options with anything in _config.yml, and adding the given options on top
+override+ is a Hash of config directives
Returns Hash
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/jekyll.rb', line 62 def self.configuration(override) # _config.yml may override default source location, but until # then, we need to know where to look for _config.yml source = override['source'] || Jekyll::DEFAULTS['source'] # Get configuration from <source>/_config.yml config_file = File.join(source, '_config.yml') begin config = YAML.load_file(config_file) raise "Invalid configuration - #{config_file}" if !config.is_a?(Hash) $stdout.puts "Configuration from #{config_file}" rescue => err $stderr.puts "WARNING: Could not read configuration. Using defaults (and options)." $stderr.puts "\t" + err.to_s config = {} end # Merge DEFAULTS < _config.yml < override Jekyll::DEFAULTS.deep_merge(config).deep_merge(override) end |
.version ⇒ Object
83 84 85 86 |
# File 'lib/jekyll.rb', line 83 def self.version yml = YAML.load(File.read(File.join(File.dirname(__FILE__), *%w[.. VERSION.yml]))) "#{yml[:major]}.#{yml[:minor]}.#{yml[:patch]}" end |