commit
529bcca927
12 changed files with 14 additions and 14 deletions
|
@ -5,7 +5,7 @@ require 'thor/group'
|
||||||
# CLI Module
|
# CLI Module
|
||||||
module Middleman
|
module Middleman
|
||||||
module Cli
|
module Cli
|
||||||
# The base task from which everything else etends
|
# The base task from which everything else extends
|
||||||
class Base < Thor
|
class Base < Thor
|
||||||
class << self
|
class << self
|
||||||
def start(*args)
|
def start(*args)
|
||||||
|
|
|
@ -48,7 +48,7 @@ module Middleman
|
||||||
self.class.config
|
self.class.config
|
||||||
end
|
end
|
||||||
|
|
||||||
# Backwards compatibilty with old Sinatra template interface
|
# Backwards compatibility with old Sinatra template interface
|
||||||
#
|
#
|
||||||
# @deprecated Prefer accessing settings through "config".
|
# @deprecated Prefer accessing settings through "config".
|
||||||
#
|
#
|
||||||
|
|
|
@ -214,7 +214,7 @@ module Middleman
|
||||||
locals = options[:locals]
|
locals = options[:locals]
|
||||||
|
|
||||||
if ::Tilt[found_partial]
|
if ::Tilt[found_partial]
|
||||||
# Render the partial if found, otherwide throw exception
|
# Render the partial if found, otherwise throw exception
|
||||||
_render_with_all_renderers(found_partial, locals, self, options, &block)
|
_render_with_all_renderers(found_partial, locals, self, options, &block)
|
||||||
else
|
else
|
||||||
read_template_file(found_partial)
|
read_template_file(found_partial)
|
||||||
|
@ -265,7 +265,7 @@ module Middleman
|
||||||
# Try to work around: https://github.com/middleman/middleman/issues/501
|
# Try to work around: https://github.com/middleman/middleman/issues/501
|
||||||
locs = locs.dup
|
locs = locs.dup
|
||||||
|
|
||||||
# Detect the remdering engine from the extension
|
# Detect the rendering engine from the extension
|
||||||
extension = File.extname(path)
|
extension = File.extname(path)
|
||||||
engine = extension[1..-1].to_sym
|
engine = extension[1..-1].to_sym
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Middleman
|
||||||
|
|
||||||
# When in dev
|
# When in dev
|
||||||
app.configure :development do
|
app.configure :development do
|
||||||
# Include middlemare
|
# Include middleware
|
||||||
use ::Rack::ShowExceptions if config[:show_exceptions]
|
use ::Rack::ShowExceptions if config[:show_exceptions]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,7 +59,7 @@ module Middleman
|
||||||
|
|
||||||
if path_parts.size == 1
|
if path_parts.size == 1
|
||||||
sitemap_class = SitemapResource
|
sitemap_class = SitemapResource
|
||||||
# Allow special sitemap resources to use custom metadata view calsses
|
# Allow special sitemap resources to use custom metadata view classes
|
||||||
sitemap_class = resource.meta_pages_class if resource.respond_to? :meta_pages_class
|
sitemap_class = resource.meta_pages_class if resource.respond_to? :meta_pages_class
|
||||||
|
|
||||||
@children[first_part] = sitemap_class.new(resource)
|
@children[first_part] = sitemap_class.new(resource)
|
||||||
|
|
|
@ -199,7 +199,7 @@ module Middleman
|
||||||
@listener.start
|
@listener.start
|
||||||
end
|
end
|
||||||
|
|
||||||
# Trap some interupt signals and shut down smoothly
|
# Trap some interrupt signals and shut down smoothly
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def register_signal_handlers
|
def register_signal_handlers
|
||||||
%w(INT HUP TERM QUIT).each do |sig|
|
%w(INT HUP TERM QUIT).each do |sig|
|
||||||
|
|
|
@ -70,7 +70,7 @@ module Middleman
|
||||||
config[:server_name] = server_name
|
config[:server_name] = server_name
|
||||||
end
|
end
|
||||||
|
|
||||||
# Make information of internal server class avaible to make debugging
|
# Make information of internal server class available to make debugging
|
||||||
# easier. This can be used to log the class which was used to determine
|
# easier. This can be used to log the class which was used to determine
|
||||||
# the preview server settings
|
# the preview server settings
|
||||||
#
|
#
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Middleman
|
||||||
module Liquid
|
module Liquid
|
||||||
# Setup extension
|
# Setup extension
|
||||||
class << self
|
class << self
|
||||||
# Once registerd
|
# Once registered
|
||||||
def registered(app)
|
def registered(app)
|
||||||
app.before_configuration do
|
app.before_configuration do
|
||||||
template_extensions liquid: :html
|
template_extensions liquid: :html
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Middleman::Sitemap::Extensions
|
||||||
module ContentType
|
module ContentType
|
||||||
# The preferred MIME content type for this resource
|
# The preferred MIME content type for this resource
|
||||||
def content_type
|
def content_type
|
||||||
# Allow explcitly setting content type from page/proxy options
|
# Allow explicitly setting content type from page/proxy options
|
||||||
meta_type = metadata[:options][:content_type]
|
meta_type = metadata[:options][:content_type]
|
||||||
return meta_type if meta_type
|
return meta_type if meta_type
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ module Middleman
|
||||||
rebuild_resource_list!(:registered_new)
|
rebuild_resource_list!(:registered_new)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Rebuild the list of resources from scratch, using registed manipulators
|
# Rebuild the list of resources from scratch, using registered manipulators
|
||||||
# rubocop:disable UnusedMethodArgument
|
# rubocop:disable UnusedMethodArgument
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def rebuild_resource_list!(reason=nil)
|
def rebuild_resource_list!(reason=nil)
|
||||||
|
@ -99,7 +99,7 @@ module Middleman
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Invalidate our cached view of resource that are not ingnored. If your extension
|
# Invalidate our cached view of resource that are not ignored. If your extension
|
||||||
# adds ways to ignore files, you should call this to make sure #resources works right.
|
# adds ways to ignore files, you should call this to make sure #resources works right.
|
||||||
def invalidate_resources_not_ignored_cache!
|
def invalidate_resources_not_ignored_cache!
|
||||||
@resources_not_ignored = nil
|
@resources_not_ignored = nil
|
||||||
|
|
|
@ -112,7 +112,7 @@ module Middleman
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get a recusive list of files inside a path.
|
# Get a recursive list of files inside a path.
|
||||||
# Works with symlinks.
|
# Works with symlinks.
|
||||||
#
|
#
|
||||||
# @param path Some path string or Pathname
|
# @param path Some path string or Pathname
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Middleman::Extensions::CacheBuster < ::Middleman::Extension
|
||||||
else
|
else
|
||||||
# It's a template, possible with partials. We can't really
|
# It's a template, possible with partials. We can't really
|
||||||
# know when it's updated, so generate fresh cache buster every
|
# know when it's updated, so generate fresh cache buster every
|
||||||
# time during developement
|
# time during development
|
||||||
http_path << '?' + Time.now.strftime('%s')
|
http_path << '?' + Time.now.strftime('%s')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue