From 8dc1e41fc015f10aa514d7ff524c5b77ae4f5d0c Mon Sep 17 00:00:00 2001 From: Conor Sinclair Date: Sun, 5 May 2024 20:41:46 +0100 Subject: [PATCH] generate templates --- README.md | 2 +- mix.exs | 2 +- priv/templates/avatar.ex | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 445e17a..1d5cc99 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Can be installed by adding `bloom` to your list of dependencies in `mix.exs`: ```elixir def deps do [ - {:bloom, "~> 0.0.2"} + {:bloom, "~> 0.0.8"} ] end ``` diff --git a/mix.exs b/mix.exs index 6291a4a..e78b2e3 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Bloom.MixProject do def project do [ app: :bloom, - version: "0.0.7", + version: "0.0.8", elixir: "~> 1.16", start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/priv/templates/avatar.ex b/priv/templates/avatar.ex index d40f90d..4a5da10 100644 --- a/priv/templates/avatar.ex +++ b/priv/templates/avatar.ex @@ -44,10 +44,14 @@ defmodule <%= @module_name %>Web.Components.Avatar do attr(:rest, :global) def avatar(assigns) do + image = + assigns[:img_src] || + "https://api.dicebear.com/8.x/#{assigns[:style]}/svg?seed=#{assigns[:name]}" + ~H"""
{"#{@name}