From 3614141c8ec5ee97c06e41d516b22ab6707f9f89 Mon Sep 17 00:00:00 2001
From: uvok cheetah
Date: Sun, 6 Oct 2024 11:14:53 +0200
Subject: Improve image tag for IPFS
---
_plugins/image.rb | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to '_plugins')
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'
+ "#{alt}"
+ elsif alt
""
else
""
--
cgit v1.2.3