diff options
Diffstat (limited to '_plugins')
-rw-r--r-- | _plugins/image.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/_plugins/image.rb b/_plugins/image.rb index 93b70e9..0a202ca 100644 --- a/_plugins/image.rb +++ b/_plugins/image.rb @@ -10,9 +10,14 @@ module Jekyll end def render(context) + environment = ENV['JEKYLL_ENV'] || 'development' + url = @params['url'] - alt = @params['alt'] - if alt + alt = @params['alt'] || "Link to image" + + if environment == 'ipfs' + "<a href='#{url}'>#{alt}</a>" + elsif alt "<img src='#{url}' alt='#{alt}' />" else "<img src='#{url}' />" |