diff --git a/lib/beacon_web/components/components.ex b/lib/beacon_web/components/components.ex index 2998b681b..0ff43bc2a 100644 --- a/lib/beacon_web/components/components.ex +++ b/lib/beacon_web/components/components.ex @@ -32,6 +32,80 @@ defmodule BeaconWeb.Components do """ end + @doc """ + Renders a feature page item to be used in the BeaconWeb.Components.featured_pages component. + + ## Examples + + + """ + + attr :title, :string, required: true + attr :published_date, :any, required: true + attr :image_path, :string, required: true + + def feature_page_item(assigns) do + ~H""" +
+
+

+ + <%= @title %> + +

+ +
+
+

+

+ +

+
+
+
+
+ Narwin +
+
+ """ + end + + @doc """ + + Renders a feature pages component. + + ## Examples + + + """ + + attr :site_pages, :list, default: [] + + def featured_pages(assigns) do + assigns = Map.put(assigns, :site_pages, Beacon.Content.list_pages(Process.get(:__beacon_site__), per_page: 3)) + + ~H""" +
+
+

+ Our Featured Blog Posts +

+

+ Recommended Reading +

+
+ +
+
+ +
+
+
+ """ + end + @doc """ Renders a image previously uploaded in Admin Media Library with srcset.