Files
mobilizon-frontend/lib/web/templates/page/index.html.heex
setop 52ef7fb9af feat(backend): add html hooks into the app main page
html snippets are injected in the main template.
they can be defined in the application config.
documentation to come.

closes #1719
2025-06-16 23:30:51 +02:00

43 lines
1.9 KiB
Plaintext

<!DOCTYPE html>
<html lang={Map.get(assigns, :locale, "en")} dir={language_direction(assigns)}>
<head>
<%= raw(Mobilizon.Config.get([:html_hooks, :app_index_html_head_first], "")) %>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="apple-touch-icon" href={favicon_url()} sizes={favicon_sizes()} />
<link rel="icon" href={favicon_url()} sizes={favicon_sizes()} />
<link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color={theme_color()} />
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="theme-color" content={theme_color()} />
<script>
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
</script>
<%= if root?(assigns) do %>
<link rel="preload" href="/img/shape-1.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 %>
<%= Vite.vite_client() %>
<%= Vite.vite_snippet("src/main.ts") %>
<%= raw(Mobilizon.Config.get([:html_hooks, :app_index_html_head_last], "")) %>
</head>
<body>
<%= raw(Mobilizon.Config.get([:html_hooks, :app_index_html_body_first], "")) %>
<noscript>
<strong>
We're sorry but Mobilizon doesn't work properly without JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<%= raw(Mobilizon.Config.get([:html_hooks, :app_index_html_body_last], "")) %>
</body>
</html>