diff --git a/lib/changelog_web/meta/admin_title.ex b/lib/changelog_web/meta/admin_title.ex index 612243d52e..7dcdd27dbc 100644 --- a/lib/changelog_web/meta/admin_title.ex +++ b/lib/changelog_web/meta/admin_title.ex @@ -4,15 +4,8 @@ defmodule ChangelogWeb.Meta.AdminTitle do @suffix "Admin" - def get(type, conn) do + def get(conn) do assigns = Meta.prep_assigns(conn) - - case type do - :page -> page_title(assigns) - end - end - - defp page_title(assigns) do assigns |> title() |> put_suffix() end diff --git a/lib/changelog_web/meta/title.ex b/lib/changelog_web/meta/title.ex index f2de2ba3ce..7d3401520b 100644 --- a/lib/changelog_web/meta/title.ex +++ b/lib/changelog_web/meta/title.ex @@ -15,28 +15,16 @@ defmodule ChangelogWeb.Meta.Title do SearchView } - @default "News and podcasts for developers" + @default "Podcasts for developers" - def get(type, conn) do + def get(conn) do view = Phoenix.Controller.view_module(conn) template = Phoenix.Controller.view_template(conn) assigns = Map.merge(conn.assigns, %{view_module: view, view_template: template}) - case type do - :page -> page_title(assigns) - :share -> share_title(assigns) - end - end - - defp page_title(assigns) do - [title(assigns) || @default, "Changelog"] - |> Enum.reject(&is_nil/1) - |> Enum.join(" |> ") + title(assigns) || @default end - # no need for the suffix on these - defp share_title(assigns), do: title(assigns) || @default - # Search views defp title(%{view_module: SearchView, view_template: "search.html", query: ""}), do: "Search" diff --git a/lib/changelog_web/templates/episode/embed.html.eex b/lib/changelog_web/templates/episode/embed.html.eex index a6ae5b0f22..88d685a302 100644 --- a/lib/changelog_web/templates/episode/embed.html.eex +++ b/lib/changelog_web/templates/episode/embed.html.eex @@ -4,7 +4,7 @@ - <%= Meta.Title.get(:page, @conn) %> + <%= Meta.Title.get(@conn) %> "> diff --git a/lib/changelog_web/templates/layout/admin.html.eex b/lib/changelog_web/templates/layout/admin.html.eex index bde4dd238f..da8391acb4 100644 --- a/lib/changelog_web/templates/layout/admin.html.eex +++ b/lib/changelog_web/templates/layout/admin.html.eex @@ -6,7 +6,7 @@ - <%= Meta.AdminTitle.get(:page, @conn) %> + <%= Meta.AdminTitle.get(@conn) %> "> diff --git a/lib/changelog_web/templates/layout/app.html.eex b/lib/changelog_web/templates/layout/app.html.eex index 1ec3059b9a..0baa7eacb1 100644 --- a/lib/changelog_web/templates/layout/app.html.eex +++ b/lib/changelog_web/templates/layout/app.html.eex @@ -5,14 +5,14 @@ - <%= Meta.Title.get(:page, @conn) %> + <%= Meta.Title.get(@conn) %> <% twitter_card_type = Meta.Twitter.get(:card_type, @conn) %> - <%= if twitter_card_type == "player" do %> @@ -31,7 +31,7 @@ <% end %> - +