Class: Octopress::Ink::Page
- Inherits:
-
Jekyll::Page
- Object
- Jekyll::Page
- Octopress::Ink::Page
- Includes:
- Convertible
- Defined in:
- lib/octopress-ink/jekyll/page.rb
Instance Attribute Summary collapse
-
#asset ⇒ Object
Returns the value of attribute asset.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#name ⇒ Object
Returns the value of attribute name.
-
#plugin ⇒ Object
Returns the value of attribute plugin.
Instance Method Summary collapse
- #relative_asset_path ⇒ Object
- #render(layouts, site_payload) ⇒ Object
-
#url ⇒ Object
Allow pages to read url from plugin configuration.
Methods included from Convertible
Instance Attribute Details
#asset ⇒ Object
Returns the value of attribute asset.
5 6 7 |
# File 'lib/octopress-ink/jekyll/page.rb', line 5 def asset @asset end |
#dir ⇒ Object
Returns the value of attribute dir.
5 6 7 |
# File 'lib/octopress-ink/jekyll/page.rb', line 5 def dir @dir end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/octopress-ink/jekyll/page.rb', line 5 def name @name end |
#plugin ⇒ Object
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_path ⇒ Object
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 |
#url ⇒ Object
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 |