diff --git a/app/Classes/Bundle.php b/app/Classes/Bundle.php index 0da9d15..f649c82 100644 --- a/app/Classes/Bundle.php +++ b/app/Classes/Bundle.php @@ -65,12 +65,12 @@ public function getDisk(): FilesystemAdapter /** * Return the section where this bundle is located */ - public function getSection(): string + public function getSection(): ?Bundle { $parts = preg_split('#/#', $this->path, -1, PREG_SPLIT_NO_EMPTY); if (count($parts) > 0) { - return config(sprintf('sections.%s.title', $parts[0]), $parts[0]); + return new Bundle($parts[0], $this->disk); } return null; @@ -123,7 +123,7 @@ public function getArticleTitle(): string public function getSiteTitle(): string { - return $this->getArticleTitle() . ' - ' . $this->getSection(); + return $this->getArticleTitle() . ' - ' . $this->getSection()->getArticleTitle(); } public function render() diff --git a/app/Classes/Link.php b/app/Classes/Link.php index 3b8dac4..e66e47a 100644 --- a/app/Classes/Link.php +++ b/app/Classes/Link.php @@ -297,14 +297,14 @@ private function fetchBundleTitle(): string if (!empty($date)) { return sprintf( 'Lien interne : [%s] %s | PubliƩ le %s', - $section, + $section->getArticleTitle(), $title, Carbon::parse($date)->format('d/m/Y') ); } else { return sprintf( 'Lien interne : [%s] %s', - $section, + $section->getArticleTitle(), $title, ); }