Files
chess-endgame-trainer/lib/chesstrainer/branding.ex
T
owenrees 37e0ac8e56 Transactional mail, crawler metadata, and asset measurement (#179)
* Send transactional email from no-reply@mail.innersquare.app

Centralise the sender identity, reply-to address and SES configuration set in Chesstrainer.Mail so no notifier can drift. Add MAIL_REDIRECT_TO for smoke tests and a mix mail.check task that exercises the SES mailbox simulators, and document the setup in the deploy guide and .env.example.

* Tighten crawler metadata and keep play pages out of search

Canonical URLs no longer carry query strings, public pages get an OG image, WebSite JSON-LD and a per-page language, and the sitemap dates the landing page only. Play and guest-training routes are marked noindex so tens of thousands of near-identical pages stay out of the index.

* Measure built asset sizes with mix assets.sizes

Report raw, gzip and brotli sizes for built JS and CSS, and record the current numbers plus the board-code split recommendation in docs/assets.md.
2026-11-17 10:29:45 +01:00

44 lines
1.4 KiB
Elixir

defmodule Chesstrainer.Branding do
@moduledoc """
Public-facing branding, read from `config :chesstrainer, :branding`.
Keeps display names out of templates and controllers so the site can be
renamed in one place. Values are read at runtime, so a deploy can override
them without recompiling.
"""
@defaults [
name: "Inner Square Chess",
wordmark: "INNERSQUARE",
tagline: "Endgame Trainer",
support_email: "support@innersquare.app",
mail_from: "no-reply@mail.innersquare.app"
]
@doc "The display name, e.g. `\"Lucid Chess\"`."
def name, do: get(:name)
@doc "The short wordmark used in the navbar and footer."
def wordmark, do: get(:wordmark)
@doc "The tagline appended to the home title, e.g. `\"Endgame Trainer\"`."
def tagline, do: get(:tagline)
@doc "The support address shown in legal pages and used as the mailer reply-to."
def support_email, do: get(:support_email)
@doc "The From address used for outgoing mail."
def mail_from, do: get(:mail_from)
@doc "The home-page title, e.g. `\"Lucid Chess — Endgame Trainer\"`."
def home_title, do: "#{name()} — #{tagline()}"
@doc "Builds a page title, e.g. `title(\"Privacy Policy\")`."
def title(page), do: "#{page} — #{name()}"
defp get(key) do
config = Application.get_env(:chesstrainer, :branding) || []
Keyword.get(config, key, Keyword.fetch!(@defaults, key))
end
end