Class: Octopress::Ink::Page

Inherits:
Jekyll::Page
  • Object
show all
Includes:
Convertible
Defined in:
lib/octopress-ink/jekyll/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Convertible

#read_yaml

Instance Attribute Details

#assetObject

Returns the value of attribute asset.



5
6
7
# File 'lib/octopress-ink/jekyll/page.rb', line 5

def asset
  @asset
end

#dirObject

Returns the value of attribute dir.



5
6
7
# File 'lib/octopress-ink/jekyll/page.rb', line 5

def dir
  @dir
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/octopress-ink/jekyll/page.rb', line 5

def name
  @name
end

#pluginObject

Returns the value of attribute plugin.



5
6
7
# File 'lib/octopress-ink/jekyll/page.rb', line 5

def plugin
  @plugin
end

Instance Method Details

#relative_asset_pathObject



7
8
9
10
11
# File 'lib/octopress-ink/jekyll/page.rb', line 7

def relative_asset_path
  site_source = Pathname.new Octopress.site.source
  page_source = Pathname.new @base
  page_source.relative_path_from(site_source).to_s
end

#render(layouts, site_payload) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/octopress-ink/jekyll/page.rb', line 13

def render(layouts, site_payload)
  site_payload = {
    'plugin' => plugin.config(data['lang'])
  }.merge(site_payload)

  super(layouts, site_payload)
end

#urlObject

Allow pages to read url from plugin configuration



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/octopress-ink/jekyll/page.rb', line 24

def url
  @url ||= begin
    super

    if @url && @url =~ /\/$/
      if self.ext == '.xml'
        @url = File.join(url, "index.xml")
      else
        @url = File.join(url, "index.html")
      end
    end

    @url
  end
end