🔧 Ajoute la configuration OG

Pour #8
This commit is contained in:
Clement 2020-07-27 11:50:54 +02:00
parent d14694f162
commit 87b71213eb
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Home; use App\Home;
use Artesaos\SEOTools\Traits\SEOTools as SEOToolsTrait; use Artesaos\SEOTools\Traits\SEOTools as SEOToolsTrait;
use DateTime;
class PublicController extends Controller class PublicController extends Controller
{ {
@ -18,6 +19,10 @@ class PublicController extends Controller
->addImages(array_map(static function($picture) { ->addImages(array_map(static function($picture) {
return asset($picture); return asset($picture);
}, $home->pictures)); }, $home->pictures));
$this->seo()
->opengraph()
->addProperty('article:published_time', $home->created_at->format(DateTime::ATOM))
->addProperty('article:author', 'Shikiryu');
return view('public.view', ['home' => $home]); return view('public.view', ['home' => $home]);
} }

View File

@ -40,7 +40,7 @@ return [
'description' => false, 'description' => false,
'url' => false, // Set null for using Url::current(), set false to total remove 'url' => false, // Set null for using Url::current(), set false to total remove
'type' => 'article', 'type' => 'article',
'site_name' => false, 'site_name' => 'Le projet Bretagne',
'images' => [], 'images' => [],
], ],
], ],