lib/octopress-ink/assets/asset.rb in octopress-ink-1.0.0.rc.11 vs lib/octopress-ink/assets/asset.rb in octopress-ink-1.0.0.rc.13
- old
+ new
@@ -66,10 +66,12 @@
end
# Copy asset to user override directory
#
def copy(target_dir)
+ return unless exists? plugin_path
+
if target_dir
target_dir = File.join(target_dir, base)
else
target_dir = user_dir
end
@@ -81,13 +83,13 @@
# Remove files from Jekyll's static_files array so it doesn't end up in the
# compiled site directory.
#
def remove_jekyll_asset
- Ink.site.static_files.clone.each do |sf|
+ Octopress.site.static_files.clone.each do |sf|
if sf.kind_of?(Jekyll::StaticFile) && sf.path == path.to_s
- Ink.site.static_files.delete(sf)
+ Octopress.site.static_files.delete(sf)
end
end
end
def destination
@@ -108,36 +110,32 @@
#
def render
content = path.read
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
- payload = Ink.site.site_payload
+ payload = Octopress.site.site_payload
content = $POSTMATCH
payload['page'] = SafeYAML.load($1)
- render_liquid(content, payload)
+ Liquid::Template.parse(content).render!(payload)
else
content
end
end
- def render_liquid(content, payload={})
- Liquid::Template.parse(content).render!(Ink.payload(payload), {})
- end
-
def plugin_dir
File.join root, base
end
def plugin_path
File.join plugin_dir, file
end
def user_dir
- File.join Ink.site.source, Plugins.custom_dir, dir
+ File.join Octopress.site.source, Plugins.custom_dir, dir
end
def local_plugin_path
- File.join Ink.site.source, dir, file
+ File.join Octopress.site.source, dir, file
end
def user_override_path
File.join user_dir, filename
end