markdown($this->data); $frontMatter = []; $title = ''; if ($content instanceof League\CommonMark\Extension\FrontMatter\Output\RenderedContentWithFrontMatter) { $frontMatter = $content->getFrontMatter(); $title = $frontMatter['title'] ?? ''; } if ($title === '') { $found = preg_match('/#+(.*)/', $this->data, $matches); if ($found) { $title = $matches[1]; } } if (!empty($title)) { $this->headTitle($title); } ?> getContent();