refactor: dynamicize structured data fields and integrate entrance animations on web development page

This commit is contained in:
Ümit Tunç
2026-05-23 23:34:43 +03:00
parent c2767f031a
commit 45c9fa24d0
2 changed files with 80 additions and 36 deletions
+34 -3
View File
@@ -57,9 +57,6 @@ abstract class StructuredData
return $node;
}
/**
* @return array<string, mixed>
*/
protected static function organizationNode(): array
{
$siteUrl = static::siteUrl();
@@ -81,6 +78,40 @@ abstract class StructuredData
];
}
$phone = setting('contact_phone');
if ($phone) {
$node['telephone'] = $phone;
}
$email = setting('contact_email');
if ($email) {
$node['email'] = $email;
}
$address = setting('contact_address');
if ($address) {
$node['address'] = [
'@type' => 'PostalAddress',
'streetAddress' => $address,
];
}
$socialLinks = setting('social_links');
if ($socialLinks) {
$links = is_string($socialLinks) ? json_decode($socialLinks, true) : $socialLinks;
if (is_array($links)) {
$sameAs = [];
foreach ($links as $platform => $url) {
if (!empty($url)) {
$sameAs[] = $url;
}
}
if (!empty($sameAs)) {
$node['sameAs'] = $sameAs;
}
}
}
return $node;
}