package templates // Package-level signup-visibility hook, wired once at startup the same way // middleware.SetDefaultPasswordSettings wires the password policy: a shared // component (SidebarSignIn's "Create an account" link) renders inside many // page templates whose call sites have no per-page flag, so the templates // package asks a closure backed by the live settings registry instead. // The closure is re-evaluated on every render, so admin changes apply // immediately without a restart. // signupVisible reports whether public signup surfaces (front page, login // page, logged-out sidebar) should render. Unwired → default true. var signupVisible func() bool // SetSignupVisibility wires the live visibility closure from main. Nil-safe: // before wiring, all surfaces render (historical behavior). func SetSignupVisibility(f func() bool) { signupVisible = f } // SignupVisible consults the wired closure (defaults to visible). func SignupVisible() bool { if signupVisible == nil { return true } return signupVisible() }