diff --git a/.formatter.exs b/.formatter.exs new file mode 100644 index 0000000..4871757 --- /dev/null +++ b/.formatter.exs @@ -0,0 +1,6 @@ +[ + import_deps: [:phoenix], + plugins: [Phoenix.LiveView.HTMLFormatter], + inputs: ["*.{heex,ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{heex,ex,exs}"], + trailing_comma: true +] diff --git a/config/prod.exs b/config/prod.exs index 7878655..a19a2a2 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -5,7 +5,8 @@ import Config # manifest is generated by the `mix assets.deploy` task, # which you should run after static files are built and # before starting your production server. -config :alchemy_pub, AlchemyPubWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json" +config :alchemy_pub, AlchemyPubWeb.Endpoint, + cache_static_manifest: "priv/static/cache_manifest.json" # Configures Swoosh API Client config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: AlchemyPub.Finch diff --git a/lib/alchemy_pub_web/components/core_components.ex b/lib/alchemy_pub_web/components/core_components.ex index 85ec626..77bc43d 100644 --- a/lib/alchemy_pub_web/components/core_components.ex +++ b/lib/alchemy_pub_web/components/core_components.ex @@ -79,7 +79,7 @@ defmodule AlchemyPubWeb.CoreComponents do
- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}
@@ -124,9 +124,9 @@ defmodule AlchemyPubWeb.CoreComponents do

<.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-4 w-4" /> <.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-4 w-4" /> - <%= @title %> + {@title}

-

<%= msg %>

+

{msg}

@@ -157,7 +157,7 @@ defmodule AlchemyPubWeb.CoreComponents do phx-connected={hide("#client-error")} hidden > - <%= gettext("Attempting to reconnect") %> + {gettext("Attempting to reconnect")} <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" /> @@ -169,7 +169,7 @@ defmodule AlchemyPubWeb.CoreComponents do phx-connected={hide("#server-error")} hidden > - <%= gettext("Hang in there while we get back on track") %> + {gettext("Hang in there while we get back on track")} <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" /> @@ -203,9 +203,9 @@ defmodule AlchemyPubWeb.CoreComponents do ~H""" <.form :let={f} for={@for} as={@as} {@rest}>
- <%= render_slot(@inner_block, f) %> + {render_slot(@inner_block, f)}
- <%= render_slot(action, f) %> + {render_slot(action, f)}
@@ -237,7 +237,7 @@ defmodule AlchemyPubWeb.CoreComponents do ]} {@rest} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end @@ -321,9 +321,9 @@ defmodule AlchemyPubWeb.CoreComponents do class="rounded border-zinc-300 text-zinc-900 focus:ring-0" {@rest} /> - <%= @label %> + {@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg} """ end @@ -331,7 +331,7 @@ defmodule AlchemyPubWeb.CoreComponents do def input(%{type: "select"} = assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -350,7 +350,7 @@ defmodule AlchemyPubWeb.CoreComponents do def input(%{type: "textarea"} = assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -370,7 +370,7 @@ defmodule AlchemyPubWeb.CoreComponents do def input(assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -397,7 +397,7 @@ defmodule AlchemyPubWeb.CoreComponents do def label(assigns) do ~H""" """ end @@ -411,7 +411,7 @@ defmodule AlchemyPubWeb.CoreComponents do ~H"""

<.icon name="hero-exclamation-circle-mini" class="mt-0.5 h-5 w-5 flex-none" /> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

""" end @@ -430,13 +430,13 @@ defmodule AlchemyPubWeb.CoreComponents do

- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

- <%= render_slot(@subtitle) %> + {render_slot(@subtitle)}

-
<%= render_slot(@actions) %>
+
{render_slot(@actions)}
""" end @@ -477,9 +477,9 @@ defmodule AlchemyPubWeb.CoreComponents do - + @@ -497,7 +497,7 @@ defmodule AlchemyPubWeb.CoreComponents do
- <%= render_slot(col, @row_item.(row)) %> + {render_slot(col, @row_item.(row))}
@@ -508,7 +508,7 @@ defmodule AlchemyPubWeb.CoreComponents do :for={action <- @action} class="relative ml-4 font-semibold leading-6 text-zinc-900 hover:text-zinc-700" > - <%= render_slot(action, @row_item.(row)) %> + {render_slot(action, @row_item.(row))} @@ -538,8 +538,8 @@ defmodule AlchemyPubWeb.CoreComponents do
-
<%= item.title %>
-
<%= render_slot(item) %>
+
{item.title}
+
{render_slot(item)}
@@ -564,7 +564,7 @@ defmodule AlchemyPubWeb.CoreComponents do class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700" > <.icon name="hero-arrow-left-solid" class="h-3 w-3" /> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ diff --git a/lib/alchemy_pub_web/components/layouts/root.html.heex b/lib/alchemy_pub_web/components/layouts/root.html.heex index 579ca42..37ef988 100644 --- a/lib/alchemy_pub_web/components/layouts/root.html.heex +++ b/lib/alchemy_pub_web/components/layouts/root.html.heex @@ -1,23 +1,21 @@ + + + + + <.live_title suffix=" | AlchemyPub"> + {assigns[:page_title] || "AlchemyPub"} + + + + - - - - - <.live_title suffix=" | AlchemyPub"> - <%= assigns[:page_title] || "AlchemyPub" %> - - - - - - -
- <.flash_group flash={@flash} /> - <%= @inner_content %> -
- - - \ No newline at end of file + +
+ <.flash_group flash={@flash} /> + {@inner_content} +
+ + diff --git a/lib/alchemy_pub_web/page_live.ex b/lib/alchemy_pub_web/page_live.ex index eb7f4dc..d952f54 100644 --- a/lib/alchemy_pub_web/page_live.ex +++ b/lib/alchemy_pub_web/page_live.ex @@ -9,15 +9,12 @@ defmodule AlchemyPubWeb.PageLive do
-
-
published <%= Map.get(@meta, "date") %>
+
+
+ published {Map.get(@meta, "date")} +
- <%= raw(@content) %> + {raw(@content)}
diff --git a/lib/alchemy_pub_web/router.ex b/lib/alchemy_pub_web/router.ex index faf9981..7386672 100644 --- a/lib/alchemy_pub_web/router.ex +++ b/lib/alchemy_pub_web/router.ex @@ -31,7 +31,7 @@ defmodule AlchemyPubWeb.Router do scope "/dev" do pipe_through :browser - phoenix_analytics_dashboard "/analytics" + phoenix_analytics_dashboard("/analytics") live_dashboard "/dashboard", metrics: AlchemyPubWeb.Telemetry forward "/mailbox", Plug.Swoosh.MailboxPreview end
<%= col[:label] %>{col[:label]} - <%= gettext("Actions") %> + {gettext("Actions")}