diff --git a/lib/community_landing/page_builder.rb b/lib/community_landing/page_builder.rb index ab739c6..1cb088e 100644 --- a/lib/community_landing/page_builder.rb +++ b/lib/community_landing/page_builder.rb @@ -140,7 +140,7 @@ module CommunityLanding hero_style_parts << "border-bottom: 1px #{hero_border} var(--cl-border);" if hero_border.present? && hero_border != "none" hero_style_parts << "min-height: #{hero_min_h}px;" if hero_min_h.to_i > 0 hero_attr = hero_style_parts.any? ? " style=\"#{hero_style_parts.join(' ')}\"" : "" - hero_classes = "cl-hero" + hero_classes = +"cl-hero" hero_classes << " cl-hero--card" if hero_card hero_classes << " cl-hero--image-first" if hero_img_first html << "
\n" diff --git a/plugin.rb b/plugin.rb index 08bb83f..f7a4a5b 100644 --- a/plugin.rb +++ b/plugin.rb @@ -54,9 +54,19 @@ after_initialize do render html: html.html_safe, layout: false, content_type: "text/html" rescue => e - Rails.logger.error("[CommunityLanding] 500 error: #{e.class}: #{e.message}\n#{e.backtrace&.first(10)&.join("\n")}") - render html: "".html_safe, - layout: false, content_type: "text/html", status: 500 + bt = e.backtrace&.first(15)&.join("\n") rescue "" + error_page = <<~HTML + + Landing Page Error + + +

CommunityLanding Error

+

#{ERB::Util.html_escape(e.class)}: #{ERB::Util.html_escape(e.message)}

+
#{ERB::Util.html_escape(bt)}
+ + HTML + render html: error_page.html_safe, layout: false, content_type: "text/html", status: 500 end private