Make page titles consistent with application structure
- All existing pages get a nice title - Suffix is "Music Library" - Fallback is current request path
This commit is contained in:
@@ -4,8 +4,8 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="csrf-token" content={get_csrf_token()} />
|
<meta name="csrf-token" content={get_csrf_token()} />
|
||||||
<.live_title suffix=" · Phoenix Framework">
|
<.live_title suffix=" · Music Library">
|
||||||
<%= assigns[:page_title] || "MusicLibrary" %>
|
<%= assigns[:page_title] || assigns.conn.request_path %>
|
||||||
</.live_title>
|
</.live_title>
|
||||||
<link rel="preconnect" href="https://rsms.me/" />
|
<link rel="preconnect" href="https://rsms.me/" />
|
||||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ defmodule MusicLibraryWeb.StatsController do
|
|||||||
records_count = Enum.reduce(records_count_by_format, 0, fn {_, count}, acc -> acc + count end)
|
records_count = Enum.reduce(records_count_by_format, 0, fn {_, count}, acc -> acc + count end)
|
||||||
latest_record = Records.get_latest_record!()
|
latest_record = Records.get_latest_record!()
|
||||||
|
|
||||||
render(conn, :index,
|
conn
|
||||||
|
|> assign(:page_title, "Stats")
|
||||||
|
|> render(:index,
|
||||||
records_count_by_format: records_count_by_format,
|
records_count_by_format: records_count_by_format,
|
||||||
records_count_by_type: records_count_by_type,
|
records_count_by_type: records_count_by_type,
|
||||||
records_count: records_count,
|
records_count: records_count,
|
||||||
|
|||||||
Reference in New Issue
Block a user