generated from boboko/starter
stoic settings and site meta and legal
This commit is contained in:
@@ -38,6 +38,18 @@ public function get(string $key, mixed $default = null): mixed
|
||||
return filled($this->data[$key] ?? null) ? $this->data[$key] : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Absolute og:image URL for a Stoic image field value (the page's own, else
|
||||
* this file's default), or null. Image fields store a comma-separated list;
|
||||
* only the first is used.
|
||||
*/
|
||||
public function ogImageUrl(?string $pageImage = null): ?string
|
||||
{
|
||||
$filename = trim(explode(',', $pageImage ?: (string) $this->get('og_image', ''))[0]);
|
||||
|
||||
return $filename === '' ? null : url(Stoic::image($filename, 'large'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Only the networks that have a URL set, in display order.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user