1
0

The bundle now provides with its own title

This commit is contained in:
Richard Dern 2024-04-21 16:27:34 +02:00
parent bc72a0a636
commit 3cc7dac8e6
2 changed files with 11 additions and 1 deletions

View File

@ -116,6 +116,16 @@ public function repair(): void
$this->save();
}
public function getArticleTitle(): string
{
return $this->metadata()->get('title') ?? Str::title(basename($this->path));
}
public function getSiteTitle(): string
{
return $this->getArticleTitle() . ' - ' . $this->getSection();
}
public function render()
{
$renderer = BundleRenderer::getBundleRendererFor($this);

View File

@ -291,7 +291,7 @@ private function fetchBundleTitle(): string
$bundle->load();
$date = $bundle->metadata()->get('date');
$title = $bundle->metadata()->get('title');
$title = $bundle->getArticleTitle();
$section = $bundle->getSection();
if (!empty($date)) {