Bug fixes and tweaks

Both hero_card_enabled and hero_image_first were crashing on the same line — they both use << to append to hero_classes. The single fix +"cl-hero" makes the string mutable, so both appends on lines 144 and 145 now work.
This commit is contained in:
2026-03-08 06:16:58 -04:00
parent 082371d728
commit 2cd36ca2b3
2 changed files with 14 additions and 4 deletions

View File

@@ -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: "<!-- CommunityLanding error: #{ERB::Util.html_escape(e.class)}: #{ERB::Util.html_escape(e.message)} -->".html_safe,
layout: false, content_type: "text/html", status: 500
bt = e.backtrace&.first(15)&.join("\n") rescue ""
error_page = <<~HTML
<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title>Landing Page Error</title>
<style>body{font-family:monospace;padding:2em;background:#111;color:#eee}
pre{background:#1a1a2e;padding:1em;overflow-x:auto;border-radius:8px;font-size:13px}</style></head>
<body>
<h1 style="color:#e74c3c">CommunityLanding Error</h1>
<p><strong>#{ERB::Util.html_escape(e.class)}</strong>: #{ERB::Util.html_escape(e.message)}</p>
<pre>#{ERB::Util.html_escape(bt)}</pre>
</body></html>
HTML
render html: error_page.html_safe, layout: false, content_type: "text/html", status: 500
end
private