From b689127a29b050b9eefac1381fe150ec0da695a8 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 20 Aug 2026 19:09:34 +0200 Subject: Add banner convention to conventions file and init.rake --- lib/ccc_conventions.rb | 10 +++++++++- lib/tasks/init.rake | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ccc_conventions.rb b/lib/ccc_conventions.rb index bb7b2033..e8ed5d68 100644 --- a/lib/ccc_conventions.rb +++ b/lib/ccc_conventions.rb @@ -2,7 +2,8 @@ module CccConventions TRASH_SLUG = "trash" ERFA_PARENT_NAME = "club/erfas" CHAOSTREFF_PARENT_NAME = "club/chaostreffs" - RESTRICTED_SUBTREES = %w[updates disclosure].freeze + BANNER_PARENT_NAME = "banner" + RESTRICTED_SUBTREES = %w[updates disclosure banner].freeze NODE_KINDS = { "top_level" => { @@ -49,6 +50,13 @@ module CccConventions path_prefix: CHAOSTREFF_PARENT_NAME, label: "Chaostreff", hint: "Automatically created under the Chaostreffs overview page, gets tag \"chaostreff-detail\", and uses the chapter detail template." + }, + "banner" => { + parent: -> { Node.find_by_unique_name!(BANNER_PARENT_NAME) }, + parent_match: ->(path) { path == ["banner"] }, + path_prefix: BANNER_PARENT_NAME, + label: "Banner", + hint: "Appears on top of every public page. Needs headline image, banner will redirect to internal redirect target or external url." } }.freeze diff --git a/lib/tasks/init.rake b/lib/tasks/init.rake index bf7bfa6b..ec233433 100644 --- a/lib/tasks/init.rake +++ b/lib/tasks/init.rake @@ -51,6 +51,7 @@ namespace :cccms do '[aggregate tags="update" limit="30" order_by="published_at" order_direction="DESC"]') ensure_node.(root, "disclosure", "Disclosure", "") + ensure_node.(root, "banner", "Banner", "") club = ensure_node.(root, "club", "Chaos Computer Club", "") ensure_node.(club, "erfas", "Erfa-Kreise", -- cgit v1.3