refactor: dynamicize structured data fields and integrate entrance animations on web development page
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user