always include title, manifest and favicon
This commit is contained in:
parent
034189afc8
commit
5a80729986
1 changed files with 14 additions and 1 deletions
|
|
@ -18,9 +18,22 @@ defmodule Pleroma.Web.Fallback.RedirectController do
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirector(conn, _params, code \\ 200) do
|
def redirector(conn, _params, code \\ 200) do
|
||||||
|
{:ok, index_content} = File.read(index_file_path())
|
||||||
|
|
||||||
|
title = "<title>#{Pleroma.Config.get([:instance, :name])}</title>"
|
||||||
|
favicon = "<link rel='icon' href='#{Pleroma.Config.get([:instance, :favicon])}'>"
|
||||||
|
manifest = "<link rel='manifest' href='/manifest.json'>"
|
||||||
|
|
||||||
|
response =
|
||||||
|
index_content
|
||||||
|
|> String.replace(
|
||||||
|
"<!--server-generated-meta-->",
|
||||||
|
title <> favicon <> manifest
|
||||||
|
)
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("text/html")
|
|> put_resp_content_type("text/html")
|
||||||
|> send_file(code, index_file_path())
|
|> send_resp(200, response)
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirector_with_meta(conn, %{"maybe_nickname_or_id" => maybe_nickname_or_id} = params) do
|
def redirector_with_meta(conn, %{"maybe_nickname_or_id" => maybe_nickname_or_id} = params) do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue