From 17a0f2709c1c5a4f099907bf700fc9fd6574c687 Mon Sep 17 00:00:00 2001 From: Firehose Bot Date: Tue, 24 Mar 2026 14:56:54 +0000 Subject: [PATCH] Add current_tag attribute to post_index component --- blogex/lib/blogex/components.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blogex/lib/blogex/components.ex b/blogex/lib/blogex/components.ex index 2de29ce..5751c7a 100644 --- a/blogex/lib/blogex/components.ex +++ b/blogex/lib/blogex/components.ex @@ -23,9 +23,11 @@ defmodule Blogex.Components do * `:posts` - list of `%Blogex.Post{}` structs (required) * `:base_path` - base URL path for post links (required) + * `:current_tag` - currently selected tag for highlighting (optional) """ attr :posts, :list, required: true attr :base_path, :string, required: true + attr :current_tag, :string, default: nil def post_index(assigns) do ~H""" @@ -35,7 +37,7 @@ defmodule Blogex.Components do

{post.title}

- <.post_meta post={post} base_path={@base_path} /> + <.post_meta post={post} base_path={@base_path} current_tag={@current_tag} />

{post.description}