towerops/lib/towerops_web/controllers/page_controller.ex
Graham McIntire 1ce1738fc5 fix: set explicit robots meta, Twitter Card tags, and WebP favicon
Adds <meta name='robots'>, twitter:card/title/description meta tags, and WebP favicon reference to the root layout. Fixes title duplication (TowerOps | TowerOps -> Home | TowerOps) by passing page_title from the page controller.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-31 09:53:37 -05:00

43 lines
1 KiB
Elixir

defmodule ToweropsWeb.PageController do
@moduledoc false
use ToweropsWeb, :controller
def home(conn, _params) do
conn = put_link_headers(conn)
if conn.assigns.current_scope && conn.assigns.current_scope.user do
redirect(conn, to: ~p"/dashboard")
else
render(conn, :home, layout: false, page_title: "Home")
end
end
defp put_link_headers(conn) do
link_value =
Enum.join(
[
~s(</.well-known/api-catalog>; rel="api-catalog"),
~s(</docs/api>; rel="service-doc"),
~s(</health>; rel="status")
],
", "
)
put_resp_header(conn, "link", link_value)
end
def privacy(conn, _params) do
render(conn, :privacy,
current_scope: conn.assigns[:current_scope],
current_organization: conn.assigns[:current_organization]
)
end
def terms(conn, _params) do
render(conn, :terms,
current_scope: conn.assigns[:current_scope],
current_organization: conn.assigns[:current_organization]
)
end
end