Meta data (OpenGraph) toegevoegd.

This commit is contained in:
2020-02-05 00:40:55 +01:00
parent dc10050e40
commit 1b7527cccf
4 changed files with 62 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ class CalendarEvent extends Model {
public $video;
public $keywords;
public $url;
public $metadata;
public function __construct($data, $images = null, $podcast = null) {
parent::__construct($data);
@@ -46,6 +47,12 @@ class CalendarEvent extends Model {
}
$this->url = "/agenda/{$this->id}/" . parent::url_slug($this->title);
$this->metadata = (new MetaData())
->set('title', $this->title)
->set('description', strip_tags($this->excerpt()))
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
;
}
public function excerpt() {