Logo base64 encoding

This commit is contained in:
2026-03-11 10:46:34 -04:00
parent 13d63d101e
commit 81785aecf9
4 changed files with 10 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -863,12 +863,15 @@ module CommunityLanding
end end
def render_designer_badge def render_designer_badge
dark_logo = File.join(CommunityLanding::PLUGIN_DIR, "..", "logo-dark.png") dark_logo = File.join(CommunityLanding::PLUGIN_DIR, "assets", "images", "badge-dark.png")
light_logo = File.join(CommunityLanding::PLUGIN_DIR, "..", "logo-light.png") light_logo = File.join(CommunityLanding::PLUGIN_DIR, "assets", "images", "badge-light.png")
return "" unless File.exist?(dark_logo) && File.exist?(light_logo)
dark_b64 = Base64.strict_encode64(File.binread(dark_logo)) begin
light_b64 = Base64.strict_encode64(File.binread(light_logo)) dark_b64 = Base64.strict_encode64(File.binread(dark_logo))
light_b64 = Base64.strict_encode64(File.binread(light_logo))
rescue StandardError
return ""
end
html = +"" html = +""
html << "<div class=\"cl-designer-badge\" id=\"cl-designer-badge\">\n" html << "<div class=\"cl-designer-badge\" id=\"cl-designer-badge\">\n"

View File

@@ -11,6 +11,8 @@ enabled_site_setting :community_landing_enabled
register_asset "stylesheets/community_landing/admin.css", :admin register_asset "stylesheets/community_landing/admin.css", :admin
require "base64"
after_initialize do after_initialize do
module ::CommunityLanding module ::CommunityLanding
PLUGIN_NAME = "community-landing" PLUGIN_NAME = "community-landing"