Merge pull request #12 from gargakshit/feature/title
feat: add support for custom page titles
This commit is contained in:
commit
94451e37d8
@ -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
|
||||
@ -40,7 +41,8 @@ defmodule KetbinWeb.PageController do
|
||||
render(conn, "shorten.html",
|
||||
paste: paste,
|
||||
show_edit: show_edit,
|
||||
extension: if(tail == [], do: "", else: tail)
|
||||
extension: if(tail == [], do: "", else: tail),
|
||||
page_title: paste.id
|
||||
)
|
||||
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"/>
|
||||
<title>Katbin</title>
|
||||
<%= if Map.has_key?(assigns, :page_title) do %>
|
||||
<title>Katbin - <%= @page_title %></title>
|
||||
<% else %>
|
||||
<title>Katbin</title>
|
||||
<% end %>
|
||||
<title itemprop="name">Katbin</title>
|
||||
|
||||
<meta property="og:type" content="object">
|
||||
|
Loading…
Reference in New Issue
Block a user