feat: add support for custom page titles
Also put the paste ID in the title for the show page
This commit is contained in:
parent
de365b36ad
commit
5820652ac1
@ -28,7 +28,8 @@ defmodule KetbinWeb.PageController do
|
||||
render(conn, "show.html",
|
||||
paste: paste,
|
||||
show_edit: show_edit,
|
||||
extension: List.first(tail) || ""
|
||||
extension: List.first(tail) || "",
|
||||
page_title: paste.id
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -4,7 +4,11 @@
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<%= if Map.has_key?(assigns, :page_title) do %>
|
||||
<title>Katbin - <%= @page_title %></title>
|
||||
<% else %>
|
||||
<title>Katbin</title>
|
||||
<% end %>
|
||||
<link rel="stylesheet" href={ Routes.static_path(@conn, "/assets/app.css") }/>
|
||||
<script defer type="text/javascript" src={ Routes.static_path(@conn, "/assets/app.js") }></script>
|
||||
</head>
|
||||
|
Loading…
Reference in New Issue
Block a user