= 2 && in_array($parts[1], ['blob', 'tree', 'raw', 'archive'], true)) { $view = $parts[1]; $path = implode('/', array_slice($parts, 2)); // repo.php sanitises it // blob and raw need an actual file path; tree and archive operate on the // whole repository and so may have an empty path. if ($path === '' && !in_array($view, ['tree', 'archive'], true)) { render_404(); exit; } require __DIR__ . '/repo.php'; exit; } // /{slug} if (count($parts) === 1) { $view = 'tree'; $path = ''; require __DIR__ . '/repo.php'; exit; } render_404(); exit; // ---- Views ------------------------------------------------------------------ function render_home(): void { $sort = $_GET['sort'] ?? 'newest'; if (!isset(REPO_SORTS[$sort])) { $sort = 'newest'; } $repos = get_repositories($sort); $page_title = 'Repositories'; $og_description = 'Source code and projects by jefftml.'; require __DIR__ . '/includes/header.php'; $sort_labels = [ 'newest' => 'Newest first', 'oldest' => 'Oldest first', 'name' => 'Name (A–Z)', 'slug' => 'Slug (A–Z)', ]; ?>
No repositories yet.
= e($r['description']) ?>
/= e($r['slug']) ?> · created = e(substr($r['created_at'], 0, 10)) ?>
Nothing here.
'; require __DIR__ . '/includes/footer.php'; }