lib/plate/asset.rb in plate-0.7.3 vs lib/plate/asset.rb in plate-0.7.4
- old
+ new
@@ -24,9 +24,19 @@
# name the file in the source directory site.js.coffee. The asset compilation engine will
# stop trying to render the file with an asset engine when it finds the first non-registered
# file extension. In this case, "js" is not recognized as an asset engine extension that needs
# compilation, so compilation stops and the file is written to the destination.
class Asset < Page
+ def base_path
+ assets_dir = File.join(self.site.source, 'assets')
+
+ if self.file.start_with?(assets_dir)
+ Pathname.new(File.join(self.site.source, 'assets'))
+ else
+ Pathname.new(File.join(self.site.source, 'content'))
+ end
+ end
+
# The engines in use for this asset. Engines are determined by looping through
# the extensions of the base file and associating those with a registered engine.
#
# @return [Array] List of engines in use for this file.
def engines
\ No newline at end of file