feat: patch HTML template to inject custom theme

This commit is contained in:
2025-11-09 09:26:35 +01:00
parent dce10fb971
commit 95b01afafa
3 changed files with 37 additions and 19 deletions

View File

@@ -15,22 +15,3 @@ config :asciinema, Asciinema.Emails.Mailer,
verify: :verify_none,
versions: [:"tlsv1.2", :"tlsv1.3"]
]
# Override static_paths to include our theme directory
# This allows serving custom CSS and favicon from /theme path
defmodule AsciinemaWeb do
def static_paths, do: ~w(assets fonts images js favicon.ico robots.txt theme)
end
# Define a custom layout view that injects our theme CSS and favicon
defmodule AsciinemaWeb.CustomLayoutView do
def head(_conn, _assigns) do
Phoenix.HTML.raw("""
<link rel="stylesheet" href="/theme/custom.css">
<link rel="icon" type="image/svg+xml" href="/theme/favicon.svg">
""")
end
end
# Override the layout view to use our custom head function
config :asciinema, AsciinemaWeb.LayoutView, head: &AsciinemaWeb.CustomLayoutView.head/2