Slide 16
Slide 16 text
private function getArticles():array
{
$issues = $this->getGitHubIssues();
$articles = [];
foreach($issues as $issue) {
$body = $issue->body;
if(preg_match('/### Perm:([a-zA-Z0-9\-]{0,})/', $body, $match)){
$permalink = $match[1];
$body = str_replace($match[0], '', $body);
$contents = Markdown::defaultTransform($body);
$created = date('Y-m-d H:i:s', strtotime($issue->created_at . ' +9hour'));
$articles[] = [
'permalink' => $permalink,
'title' => $issue->title,
'contents' => $contents,
'created' => $created
];
}
}
return $articles;
}
/src/command/MakeStaticContentsCommand.php