Browse files

Add site.root to asset path.

Rendering tags was not getting the correct pathname when the root was set to a subdirectory. This small feature allows a user to have their site listed under a sub-directory such as http:/site.url/my-blog and keep the features of the asset path plugin.
  • Loading branch information...
jstevens8213 committed Nov 26, 2012
1 parent 6759d8c commit 5bb47484d897c42fcf75b0e5d51bbc1383d614c6
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/jekyll/assets_plugin/tag.rb
@@ -108,7 +108,11 @@ def render_asset context
def render_asset_path context
with_asset context do |asset, site|
return asset_not_bundled unless site.has_bundled_asset? asset
- return "/#{site.assets_config.dirname}/#{asset.digest_path}"
+ root = site.config['root']
+ unless root =~ /\/$/
+ root = root + '/'
+ end
+ return "#{root}#{site.assets_config.dirname}/#{asset.digest_path}"

0 comments on commit 5bb4748

Please sign in to comment.