From e4a21084f0017c873a307ec85d0ef5ea341ce026 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sun, 8 Nov 2020 16:16:20 -0700 Subject: [PATCH] Fix title on load of Pleroma HTML --- lib/pleroma/web/fallback/redirect_controller.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pleroma/web/fallback/redirect_controller.ex b/lib/pleroma/web/fallback/redirect_controller.ex index 6f759d559..712991c18 100644 --- a/lib/pleroma/web/fallback/redirect_controller.ex +++ b/lib/pleroma/web/fallback/redirect_controller.ex @@ -37,9 +37,11 @@ def redirector_with_meta(conn, params) do tags = build_tags(conn, params) preloads = preload_data(conn, params) + title = "#{Pleroma.Config.get([:instance, :name])}" response = index_content + |> String.replace(~r/.+?<\/title>/, title) |> String.replace("<!--server-generated-meta-->", tags <> preloads) conn @@ -54,9 +56,11 @@ def redirector_with_preload(conn, %{"path" => ["pleroma", "admin"]}) do def redirector_with_preload(conn, params) do {:ok, index_content} = File.read(index_file_path()) preloads = preload_data(conn, params) + title = "<title>#{Pleroma.Config.get([:instance, :name])}" response = index_content + |> String.replace(~r/.+?<\/title>/, title) |> String.replace("<!--server-generated-meta-->", preloads) conn