class Octopress::Docs::Page
Public Class Methods
new(site, base, dir, name, config={})
click to toggle source
Purpose: Configs can override a page’s permalink
url - Path relative to destination directory.
examples: - '/' for the _site/index.html page - '/archive/' for the _site/archive/index.html page
Calls superclass method
# File lib/octopress/docs/jekyll/page.rb, line 13 def initialize(site, base, dir, name, config={}) @config = config super(site, base, dir, name) post_init if respond_to?(:post_init) end
Public Instance Methods
destination(dest)
click to toggle source
# File lib/octopress/docs/jekyll/page.rb, line 19 def destination(dest) unless @dest if @config['path'] dest = File.join(dest, @config['path']) end @dest = File.join(dest, self.url) end @dest end
relative_asset_path()
click to toggle source
# File lib/octopress/docs/jekyll/page.rb, line 29 def relative_asset_path site_source = Pathname.new Docs.site.source page_source = Pathname.new @base page_source.relative_path_from(site_source).to_s end
url()
click to toggle source
Allow pages to read url from plugin configuration
Calls superclass method
# File lib/octopress/docs/jekyll/page.rb, line 37 def url unless @url super if @url && @url =~ /\/$/ ext = (self.ext == '.xml'? 'xml' : 'html') @url = File.join(@url, "index.#{ext}") end end @url end