Add jekyll doctor command

This commit is contained in:
Parker Moore 2013-05-11 17:49:20 +02:00
parent e22b1bb74a
commit b355ef6469
3 changed files with 23 additions and 1 deletions

View File

@ -86,6 +86,20 @@ command :serve do |c|
end end
alias_command :server, :serve alias_command :server, :serve
command :doctor do |c|
c.syntax = 'jekyll doctor'
c.description = 'Search site and print specific deprecation warnings'
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
c.action do |args, options|
options = normalize_options(options.__hash__)
options = Jekyll.configuration(options)
Jekyll::Commands::Doctor.process(options)
end
end
alias_command :hyde, :doctor
command :import do |c| command :import do |c|
c.syntax = 'jekyll import <platform> [options]' c.syntax = 'jekyll import <platform> [options]'
c.description = 'Import your old blog to Jekyll' c.description = 'Import your old blog to Jekyll'

View File

@ -114,7 +114,14 @@ module Jekyll
self.data.deep_merge({ self.data.deep_merge({
"url" => self.url, "url" => self.url,
"content" => self.content, "content" => self.content,
"path" => self.data['path'] || File.join(@dir, @name).sub(/\A\//, '') }) "path" => self.data['path'] || path })
end
# The path to the source file
#
# Returns the path to the source file
def path
File.join(@dir, @name).sub(/\A\//, '')
end end
# Obtain destination path. # Obtain destination path.

View File

@ -422,6 +422,7 @@ module Jekyll
def relative_permalinks_deprecation_method def relative_permalinks_deprecation_method
if config['relative_permalinks'] && !@deprecated_relative_permalinks if config['relative_permalinks'] && !@deprecated_relative_permalinks
puts # Places newline after "Generating..."
Jekyll::Logger.warn "Deprecation:", "Starting in 1.1, permalinks for pages" + Jekyll::Logger.warn "Deprecation:", "Starting in 1.1, permalinks for pages" +
" in subfolders must be absolute" + " in subfolders must be absolute" +
" permalinks relative to the site" + " permalinks relative to the site" +