diff --git a/app/Classes/Bundle.php b/app/Classes/Bundle.php index d852547..525302e 100644 --- a/app/Classes/Bundle.php +++ b/app/Classes/Bundle.php @@ -104,6 +104,23 @@ public function getParent(): ?Bundle return $this->parent; } + public function getArticleTitle(): string + { + return $this->metadata()->get('title') ?? Str::title(basename($this->path)); + } + + public function getSiteTitle(): string + { + $title = $this->getArticleTitle(); + $section = $this->getSection(); + + if (!empty($section) && $section->getPath() !== $this->getPath()) { + $title .= ' - ' . $section->getArticleTitle(); + } + + return $title; + } + /** * Return a boolean value indicating if there already is a bundle in * specified path @@ -146,23 +163,6 @@ public function repair(): void $this->save(); } - public function getArticleTitle(): string - { - return $this->metadata()->get('title') ?? Str::title(basename($this->path)); - } - - public function getSiteTitle(): string - { - $title = $this->getArticleTitle(); - $section = $this->getSection(); - - if (!empty($section) && $section->getPath() !== $this->getPath()) { - $title .= ' - ' . $section->getArticleTitle(); - } - - return $title; - } - public function render() { $renderer = BundleRenderer::getBundleRendererFor($this);