Minor Fixes and CSS Alignment

This commit is contained in:
2026-03-08 16:47:35 -04:00
parent eed4485606
commit 435ad5e00f
5 changed files with 13 additions and 4 deletions

View File

@@ -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 (13). 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",

View File

@@ -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 (13). 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."

View File

@@ -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

View File

@@ -315,7 +315,9 @@ module CommunityLanding
if urls.any?
has_images = true
img_max_h = @s.hero_image_max_height rescue 500
html << "<div class=\"cl-hero__image\" data-hero-images=\"#{e(urls.to_json)}\">\n"
img_weight = (@s.hero_image_weight rescue 1).to_i.clamp(1, 3)
img_style = img_weight > 1 ? " style=\"flex: #{img_weight}\"" : ""
html << "<div class=\"cl-hero__image\"#{img_style} data-hero-images=\"#{e(urls.to_json)}\">\n"
html << "<img src=\"#{urls.first}\" alt=\"#{e(site_name)}\" class=\"cl-hero__image-img\" style=\"max-height: #{img_max_h}px;\">\n"
if hero_video
html << "<button class=\"cl-hero-play\" data-video-url=\"#{e(hero_video)}\"#{blur_attr} aria-label=\"Play video\">"

View File

@@ -2,7 +2,7 @@
# name: community-landing
# about: Branded public landing page for unauthenticated visitors
# version: 2.5.0
# version: 2.6.1
# authors: DPN MEDiA WORKS
# url: https://github.com/dpnmw/community-landing
# meta_url: https://dpnmediaworks.com