Get rid of some unused stuff in sitemap and complete documentation

This commit is contained in:
Ben Hollis 2012-03-25 17:38:38 -07:00
parent 189833c61f
commit b2f6d0db09
3 changed files with 6 additions and 29 deletions

View file

@ -11,19 +11,16 @@ module Middleman::Sitemap
# @return [String]
attr_accessor :path
# @return [Middleman::Sitemap::Page]
# The path of the page this page is proxied to, or nil if it's not proxied.
# @return [String]
attr_accessor :proxied_to
# @return [Symbol]
attr_accessor :status
# Initialize page with parent store and URL
# @param [Middleman::Sitemap::Store] store
# @param [String] path
def initialize(store, path)
@store = store
@path = path
@status = :generic
@source_file = nil
@proxied_to = nil
end
@ -83,30 +80,16 @@ module Middleman::Sitemap
# Whether this page is a proxy
# @return [Boolean]
def proxy?
@status == :proxy
!!@proxied_to
end
# Set this page to proxy to a target path
# @param [String] target
# @return [void]
def proxy_to(target)
@status = :proxy
@proxied_to = target
end
# Whether this page is a generic page
# @return [Boolean]
def generic?
@status == :generic
end
# Set this page to be a generic page
# @return [void]
def make_generic
@status = :generic
# TODO: Remove from ignore array?
end
# Whether this page is ignored
# @return [Boolean]
def ignored?

View file

@ -91,6 +91,8 @@ module Middleman::Sitemap
end
# Find a page given its destination path
# @param [String] The destination (output) path of a page.
# @return [Middleman::Sitemap::Page]
def page_by_destination(destination_path)
# TODO: memoize this
destination_path = normalize_path(destination_path)
@ -156,14 +158,6 @@ module Middleman::Sitemap
true
end
# Whether the sitemap should completely ignore a given file/path
# @param [String] file
# @param [String] path
# @return [Boolean]
def sitemap_should_ignore?(file, path)
@app.sitemap_ignore.every(&:call)
end
protected
# Get a path without templating extensions

View file

@ -25,7 +25,7 @@ module Middleman
autoload :Sprockets, "middleman-more/core_extensions/sprockets"
end
# User-activatable extendions
# User-activatable extensions
module Extensions
# RelativeAssets allow any asset path in dynamic templates to be either
# relative to the root of the project or use an absolute URL.