stoic settings and site meta and legal

This commit is contained in:
elvira
2026-09-28 17:32:22 +03:00
parent ca362f81c8
commit 88d8ae0954
6 changed files with 26 additions and 4 deletions
+12
View File
@@ -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.
*