From 435ad5e00fe7d48a86975e9c88bba88cfce2b391 Mon Sep 17 00:00:00 2001 From: DPN MW Date: Sun, 8 Mar 2026 16:47:35 -0400 Subject: [PATCH] Minor Fixes and CSS Alignment --- .../discourse/initializers/community-landing-admin-tabs.js | 5 +++-- config/locales/en.yml | 1 + config/settings.yml | 5 +++++ lib/community_landing/page_builder.rb | 4 +++- plugin.rb | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/discourse/initializers/community-landing-admin-tabs.js b/assets/javascripts/discourse/initializers/community-landing-admin-tabs.js index 3e63b64..7177bf7 100644 --- a/assets/javascripts/discourse/initializers/community-landing-admin-tabs.js +++ b/assets/javascripts/discourse/initializers/community-landing-admin-tabs.js @@ -1,4 +1,4 @@ -// community-landing-admin-tabs v2.5.0 +// community-landing-admin-tabs v2.6.1 import { withPluginApi } from "discourse/lib/plugin-api"; // Setting descriptions — injected into the admin DOM since the newer @@ -71,6 +71,7 @@ const DESCRIPTIONS = { hero_subtitle: "Supporting text below the headline. Describe your community's purpose.", hero_card_enabled: "Display hero content inside a rounded card with border and shadow.", hero_image_first: "Show hero image above text on mobile / left on desktop. Off = text first.", + hero_image_weight: "Image size weight (1–3). Higher values give the image more space relative to the text. Default: 1 (equal).", hero_background_image_url: "Full-bleed background image behind the hero. In card mode, fills the card with overlay.", hero_image_url: "Single hero image displayed on the right side of the hero. Use the upload button or paste a URL.", hero_multiple_images_enabled: "Enable multiple hero images (up to 5) that rotate randomly on each page load. Disables the single image upload.", @@ -284,7 +285,7 @@ const TABS = [ label: "Hero", settings: new Set([ "hero_title", "hero_accent_word", "hero_subtitle", "hero_title_size", - "hero_card_enabled", "hero_image_first", + "hero_card_enabled", "hero_image_first", "hero_image_weight", "hero_background_image_url", "hero_image_url", "hero_multiple_images_enabled", "hero_image_urls", "hero_image_max_height", "hero_primary_button_enabled", "hero_primary_button_label", "hero_primary_button_url", "hero_secondary_button_enabled", "hero_secondary_button_label", "hero_secondary_button_url", diff --git a/config/locales/en.yml b/config/locales/en.yml index 7d90d5f..968aaa9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -65,6 +65,7 @@ en: hero_subtitle: "Supporting text below the hero headline. Describe your community's purpose or value proposition." hero_card_enabled: "Display the hero content inside a rounded card container with border and shadow. When off, the hero uses a flat full-width layout." hero_image_first: "Show the hero image above the text on mobile and to the left on desktop. When off, text appears first (default)." + hero_image_weight: "Image size weight (1–3). Higher values give the image more space relative to the text. Default: 1 (equal split)." hero_background_image_url: "Full-bleed background image behind the hero section. In card mode, fills the card with a dark overlay. In flat mode, covers the entire section." hero_image_url: "Single hero image displayed on the right side of the hero. Use the upload button or paste a URL." hero_multiple_images_enabled: "Enable multiple hero images (up to 5) that rotate randomly on each page load. Disables the single image upload." diff --git a/config/settings.yml b/config/settings.yml index 0234425..afe95a0 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -211,6 +211,11 @@ plugins: hero_image_first: default: false type: bool + hero_image_weight: + default: 1 + type: integer + min: 1 + max: 3 hero_background_image_url: default: "" type: string diff --git a/lib/community_landing/page_builder.rb b/lib/community_landing/page_builder.rb index 82e8671..5887a2d 100644 --- a/lib/community_landing/page_builder.rb +++ b/lib/community_landing/page_builder.rb @@ -315,7 +315,9 @@ module CommunityLanding if urls.any? has_images = true img_max_h = @s.hero_image_max_height rescue 500 - html << "
\n" + img_weight = (@s.hero_image_weight rescue 1).to_i.clamp(1, 3) + img_style = img_weight > 1 ? " style=\"flex: #{img_weight}\"" : "" + html << "
\n" html << "\"#{e(site_name)}\"\n" if hero_video html << "