Parent
[>]
1//! Route handlers for repository pages. 2//! 3//! Covers two routes: the repository list (`/`) and the repository detail 4//! page (`/{repo}`). The detail handler opens the repository with `gix`, 5//! collects branch and tag summaries via the service layer, reads the 6//! description from `.git/description`, and renders the README as HTML. 7 8use Template; 9use WebTemplate; 10use State; 11use IntoResponse; 12 13use ; 14 15use crateSiteConfig; 16use crateResult; 17use crate; 18use crate; 19 20/// Reads the repository description from `.git/description`, returning `None` 21/// if the file is missing, empty, or contains the default git placeholder text. 22 28 29/// Returns `true` if `url` is a relative path that should be rewritten to 30/// point at the raw file serving route. 31 38 39/// Template context for the repository detail page. 40 41 42 53 54/// Renders the detail page for a single repository, including its branches, 55/// tags, and description. Returns [`Error::RepoNotFound`] if no repository 56/// exists at the given name, or [`Error::GitCorrupt`] if the ref database 57/// cannot be read. 58pub async 177 178/// Template context for a single repository in the list. 179 185 186/// Template context for the repository list page. 187 188 189 193 194/// Renders the repository list page by scanning the root directory for git 195/// repositories. Entries that cannot be opened as a git repository are 196/// skipped. The list is sorted by latest commit first. 197pub async