mirror of
https://github.com/dpnmw/community-landing.git
synced 2026-03-18 09:27:16 +00:00
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:
@@ -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 << "<section class=\"#{hero_classes}\" id=\"cl-hero\"#{hero_attr}>\n"
|
||||
|
||||
16
plugin.rb
16
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: "<!-- 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
|
||||
|
||||
Reference in New Issue
Block a user