summaryrefslogtreecommitdiff
path: root/_plugins/image.rb
diff options
context:
space:
mode:
authoruvok cheetah2024-10-06 11:14:53 +0200
committeruvok cheetah2024-10-06 11:14:53 +0200
commit3614141c8ec5ee97c06e41d516b22ab6707f9f89 (patch)
tree339997ede8507f2dfb80870792e1ed4e4627bbe2 /_plugins/image.rb
parent22db588dda817e0181b733332272191e61d85e5d (diff)
Improve image tag for IPFS
Diffstat (limited to '_plugins/image.rb')
-rw-r--r--_plugins/image.rb9
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}' />"