{$section['title']}
{$section['desc']}
get('/projects.php', mkiRedirect('/projects')); $router->get('/projects.html', mkiRedirect('/projects')); $router->get('/utilities', mkiRedirect('/projects')); $router->get('/utilities.php', mkiRedirect('/projects')); $router->get('/utilities.html', mkiRedirect('/projects')); $router->get('/projects', function() use ($db) { $projects = (new Projects($db))->getAll(); $languages = new Languages($db); $sections = [ 'projects' => [ 'title' => 'Active Projects', 'desc' => 'Projects that I work on on a fairly regular basis.', 'items' => [], ], 'tools' => [ 'title' => 'Tools', 'desc' => 'Personal quality of life tools that I update when I need something new from them.', 'items' => [], ], 'archives' => [ 'title' => 'Archived Projects', 'desc' => 'Past projects that I no longer work on.', 'items' => [], ], ]; foreach($projects as $project) { if($project->isArchived()) $sections['archives']['items'][] = $project; else { if($project->isTool()) $sections['tools']['items'][] = $project; else $sections['projects']['items'][] = $project; } } $body = fm_component('header', [ 'title' => 'flash.moe / projects', ]); foreach($sections as $sectionId => $section) { $body .= <<
{$section['desc']}
{$project->getSummary()}
"; foreach($descLines as $line) { $line = $line->trim(); if($line->isEmpty()) continue; $body .= "{$line}
"; } $body .= '