Only preload svg shapes on homepage
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
528744d765
commit
74581912f3
@ -7,9 +7,11 @@
|
|||||||
<link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png" sizes="152x152" />
|
<link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png" sizes="152x152" />
|
||||||
<link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color={theme_color()} />
|
<link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color={theme_color()} />
|
||||||
<meta name="theme-color" content={theme_color()} />
|
<meta name="theme-color" content={theme_color()} />
|
||||||
<link rel="preload" href="/img/shape-1.svg" as="image" />
|
<%= if is_root(assigns) do %>
|
||||||
<link rel="preload" href="/img/shape-2.svg" as="image" />
|
<link rel="preload" href="/img/shape-1.svg" as="image" />
|
||||||
<link rel="preload" href="/img/shape-3.svg" as="image" />
|
<link rel="preload" href="/img/shape-2.svg" as="image" />
|
||||||
|
<link rel="preload" href="/img/shape-3.svg" as="image" />
|
||||||
|
<% end %>
|
||||||
<%= tags(assigns) || assigns.tags %>
|
<%= tags(assigns) || assigns.tags %>
|
||||||
<%= Vite.inlined_phx_manifest() %>
|
<%= Vite.inlined_phx_manifest() %>
|
||||||
<%= Vite.vite_client() %>
|
<%= Vite.vite_client() %>
|
||||||
|
@ -86,4 +86,9 @@ defmodule Mobilizon.Web.PageView do
|
|||||||
def language_direction(assigns) do
|
def language_direction(assigns) do
|
||||||
assigns |> Map.get(:locale, "en") |> get_language_direction()
|
assigns |> Map.get(:locale, "en") |> get_language_direction()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@spec is_root(map()) :: boolean()
|
||||||
|
def is_root(assigns) do
|
||||||
|
assigns |> Map.get(:conn, %{request_path: "/"}) |> Map.get(:request_path, "/") == "/"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user