Class: Octopress::Categories::CategoryPageAsset
- Inherits:
-
Ink::Assets::PageAsset
- Object
- Ink::Assets::PageAsset
- Octopress::Categories::CategoryPageAsset
- Defined in:
- lib/octopress-categories/page_asset.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
Instance Method Summary collapse
- #clone(plugin, template, category) ⇒ Object
- #copy(target_dir) ⇒ Object
- #info ⇒ Object
-
#initialize(plugin, template, category) ⇒ CategoryPageAsset
constructor
A new instance of CategoryPageAsset.
- #permalink ⇒ Object
- #permalink_name ⇒ Object
Constructor Details
#initialize(plugin, template, category) ⇒ CategoryPageAsset
Returns a new instance of CategoryPageAsset.
7 8 9 10 |
# File 'lib/octopress-categories/page_asset.rb', line 7 def initialize(plugin, template, category) super(plugin, template.base, template.file) self.category = category end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
5 6 7 |
# File 'lib/octopress-categories/page_asset.rb', line 5 def category @category end |
Instance Method Details
#clone(plugin, template, category) ⇒ Object
12 13 14 15 |
# File 'lib/octopress-categories/page_asset.rb', line 12 def clone(plugin, template, category) p = CategoryPageAsset.new(plugin, template, category) p end |
#copy(target_dir) ⇒ Object
17 18 19 |
# File 'lib/octopress-categories/page_asset.rb', line 17 def copy(target_dir) # Don't copy anything end |
#info ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/octopress-categories/page_asset.rb', line 21 def info = super name = permalink_name << page.ext .sub!(/#{name}\s*/, permalink_name.ljust(35)) .sub!(/#{filename}\s*/, filename.ljust(35)) .sub!(/\.\/#{filename}*/, "#{@plugin.slug}/includes/#{filename}") end |
#permalink ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/octopress-categories/page_asset.rb', line 38 def permalink link = "/#{plugin.category_dir(category)}/" if lang link = "/#{lang}#{link}" end link end |
#permalink_name ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/octopress-categories/page_asset.rb', line 30 def permalink_name name = plugin.slugifyCategory(category) if lang name = "#{name}-#{lang}" end name end |