The bundle now provides with its own title
This commit is contained in:
parent
bc72a0a636
commit
3cc7dac8e6
|
@ -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);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user