mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
29 lines
922 B
Elixir
29 lines
922 B
Elixir
defmodule ChesstrainerWeb.PageController do
|
|
use ChesstrainerWeb, :controller
|
|
|
|
alias Chesstrainer.Attempts
|
|
alias Chesstrainer.DailyPuzzles
|
|
alias Chesstrainer.Endgames
|
|
|
|
@description "Short, focused endgame puzzles against tablebase-perfect defence. " <>
|
|
"Learn to see the winning move and make the endgame your strongest phase."
|
|
|
|
def home(conn, _params) do
|
|
endgames = Endgames.curated_endgames()
|
|
|
|
conn
|
|
|> assign(:js_entry, ~p"/assets/js/marketing.js")
|
|
|> assign(:page_title, "Lucid Chess — Endgame Trainer")
|
|
|> assign(:title_suffix, "")
|
|
|> assign(:meta_description, @description)
|
|
|> assign(:canonical_url, current_url(conn))
|
|
|> render(:home,
|
|
endgames: endgames,
|
|
active_endgame: DailyPuzzles.today(),
|
|
puzzle_count: Endgames.count_endgames(),
|
|
user_count: Attempts.count_users_with_attempts(),
|
|
today: Date.utc_today()
|
|
)
|
|
end
|
|
end
|