Class: Octopress::AssetPipeline::Css
- Inherits:
-
Asset
- Object
- Ink::Assets::Asset
- Asset
- Octopress::AssetPipeline::Css
show all
- Defined in:
- lib/octopress-asset-pipeline/assets/css.rb
Direct Known Subclasses
Sass
Instance Attribute Summary
Attributes inherited from Asset
#file_object
Instance Method Summary
collapse
Methods inherited from Asset
#base, #copy, #filename, #info, #initialize, #path
Instance Method Details
#content ⇒ Object
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 20
def content
@render ||= begin
contents = super
if asset_payload = payload
Liquid::Template.parse(contents).render!(payload)
else
contents
end
end
end
|
#destination ⇒ Object
8
9
10
|
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 8
def destination
File.join(base, output_file_name)
end
|
4
5
6
|
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 4
def media
path.to_s.scan(/@(.+?)\./).flatten[0] || 'all'
end
|
#output_file_name ⇒ Object
16
17
18
|
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 16
def output_file_name
filename.sub(/@/,'-')
end
|
#tag ⇒ Object
12
13
14
|
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 12
def tag
"<link href='#{Filters.expand_url(destination)}' media='#{media}' rel='stylesheet' type='text/css'>"
end
|