36bf64a8

Archive
Tree [36bf64a8] [>]
commit
36bf64a80e9f5ef8b4cb0ac30e6084c0535548a1
parent
author
Christopher K. Schmitt <me@shmish.dev>
date
2026-07-08
committer
Christopher K. Schmitt <me@shmish.dev>
date
2026-07-08
changes
11
insertions
47
deletions
13
Add date helpers and module-level documentation
Msrc/cli.rs
~    #[arg(long)]~    pub ssh_prefix: Option<String>,~-    /// Built-in colour theme.+    /// Built-in color theme.~    #[arg(long, default_value = "auto")]~    pub theme: Theme,~
Msrc/filters.rs
~//! Custom Askama filters.~~/// Returns `singular` if `count == 1`, otherwise `plural`.+#[allow(dead_code)]~pub fn pluralize(count: &usize, singular: &str, plural: &str) -> askama::Result<String> {~    Ok(if *count == 1 {~        singular.to_string()
Msrc/routes.rs
~        .ok()~}~+/// Formats a commit's committer date as a `YYYY-MM-DD` string in the+/// commit's local timezone, returning `None` if the time cannot be parsed.+pub(super) fn committer_date(commit: &gix::Commit) -> Option<String> {+    let sig = commit.committer().ok()?;+    let time = sig.time().ok()?;+    let zone = TimeZone::fixed(Offset::from_seconds(time.offset).ok()?);++    Timestamp::from_second(time.seconds)+        .map(|ts| ts.to_zoned(zone).date().to_string())+        .ok()+}+~/// Axum extractor that pulls the `{repo}` path parameter and validates it~/// contains no path traversal components before passing it to handlers.~pub struct RepoName(pub String);
Mstatic/base.css
~    color: var(--primary);~    font-family: var(--font-mono);~    border-top: 1px solid var(--secondary);-    }+  }~~  .repo-nav-item + .repo-nav-item { border-top: 1px solid var(--highlight); }~  .repo-nav-item:last-child { border-bottom: 1px solid var(--secondary); }
~  .tag-info a { color: var(--primary); text-decoration: none; }~  .tag-info a:hover { text-decoration: underline; text-underline-offset: 3px; }~-  .tag-message {+  .message {~    font-family: var(--font-mono);~    padding: 1rem;-    margin: 0 1rem 1rem;+    margin: 0;~    background: var(--highlight);-    border-radius: 6px;~    white-space: pre-wrap;+    word-break: break-all;~    color: var(--primary);~  }~
~  details[open] summary { color: var(--emphasized); }~  summary::after { content: '[+]'; color: var(--secondary); }~  summary:not(:has(span))::after { margin-left: auto; }-  details[open] summary::after { content: '[−]'; }+  details[open] summary::after { content: '[-]'; }~  summary span { color: var(--secondary); margin-left: auto; }~-  details > *:not(summary) { padding: 0 1rem .75rem; margin-bottom: 0; }+  details > *:not(summary) { padding: .75rem 1rem; margin-bottom: 0; }~  details > ul { list-style: none; padding: 0; margin: 0; }~  details ul li + li { border-top: 1px solid var(--highlight); }~
~    cursor: pointer;~    font-family: var(--font-mono);~    font-size: 1rem;-    }+  }~~  details ul li a:active { background-color: var(--highlight); }~
Mtemplates/branch_detail.html
~{% extends "base.html" %}~-{% block title %}{{ branch }} — {{ repo }}{% endblock %}+{% block title %}{{ branch }} - {{ repo }}{% endblock %}~~{% block breadcrumbs %}~<ul>
Mtemplates/branch_list.html
~{% extends "base.html" %}~-{% block title %}branches — {{ repo }}{% endblock %}+{% block title %}branches - {{ repo }}{% endblock %}~~{% block breadcrumbs %}~<ul>
Mtemplates/tag_detail.html
~{% extends "base.html" %}~-{% block title %}{{ tag }} — {{ repo }}{% endblock %}+{% block title %}{{ tag }} - {{ repo }}{% endblock %}~~{% block breadcrumbs %}~<ul>
~</dl>~~{% if let Some(message) = message %}-<pre class="tag-message">{{ message }}</pre>+<pre class="message">{{ message }}</pre>~{% endif %}~{% endblock %}
Mtemplates/tag_list.html
~{% extends "base.html" %}~-{% block title %}tags — {{ repo }}{% endblock %}+{% block title %}tags - {{ repo }}{% endblock %}~~{% block breadcrumbs %}~<ul>
Msrc/routes/archive.rs
+//! Archive download handler.+//!+//! Covers the route `/{repo}/archive/{format}/{*ref}`.  Streams the+//! repository archive in the requested format (`tar.gz`, `tar.xz`, or+//! `zip`) for the given ref.+~use axum::response::IntoResponse;~~pub async fn handler() -> impl IntoResponse {
Msrc/routes/commit.rs
+//! Commit log list and detail pages.+//!+//! Covers two routes: the commit log (`/{repo}/commits`) and the commit detail+//! page (`/{repo}/commits/{sha}`).  The `list` handler renders a paginated+//! commit log with an SVG ancestry graph and inline ref indicators.  The+//! `detail` handler renders a single commit view with full metadata, a diff+//! stat, and per-file inline diffs via `gix::diff::blob::UnifiedDiff`.+~use axum::response::IntoResponse;~~pub async fn detail() -> impl IntoResponse {
Msrc/routes/tree.rs
+//! Tree browser page.+//!+//! Covers two routes: `/{repo}/commits/{sha}/tree` and+//! `/{repo}/commits/{sha}/tree/{*path}`.  Renders a directory listing for the+//! given tree object, with file entries linked to the raw handler and+//! sub-directory entries linked to deeper tree pages.+~use axum::response::IntoResponse;~~pub async fn handler() -> impl IntoResponse {