diff --git a/config/seo.php b/config/seo.php new file mode 100644 index 00000000..e1e1a0b8 --- /dev/null +++ b/config/seo.php @@ -0,0 +1,42 @@ + [ + 'name' => 'GOOI&meer', + // Former names, so search engines and AI tools link them to GOOI&meer + 'alternate_names' => ['NH Gooi', '6fm'], + 'logo' => '/android-chrome-512x512.png', + 'logo_width' => 512, + 'logo_height' => 512, + + 'address' => [ + 'street' => 'IJsselmeerstraat 3B', + 'postal_code' => '1271 AA', + 'locality' => 'Huizen', + 'country' => 'NL', + ], + 'telephone' => '+31-35-6424774', + 'email' => 'info@gooienmeer.nl', + 'kvk' => '41194132', + + 'same_as' => [ + 'https://www.facebook.com/WijZijnGOOIenMeer', + 'https://www.instagram.com/gooi.en.meer', + ], + + // Pages describing the newsroom and how to give feedback / complain + 'masthead' => '/redactie', + 'feedback_policy' => '/klachten', + ], +]; diff --git a/resources/views/layouts/_head.blade.php b/resources/views/layouts/_head.blade.php index 9bee3512..1785146b 100644 --- a/resources/views/layouts/_head.blade.php +++ b/resources/views/layouts/_head.blade.php @@ -38,6 +38,7 @@ ->metaTags(); } ?> + @include('partial/site_jsonld') @stack('head') @stack('styles') diff --git a/resources/views/partial/news_jsonld.blade.php b/resources/views/partial/news_jsonld.blade.php index 5b31de88..66603bb5 100644 --- a/resources/views/partial/news_jsonld.blade.php +++ b/resources/views/partial/news_jsonld.blade.php @@ -21,16 +21,20 @@ } } + // Same organization as in partial/site_jsonld (config/seo.php); name and + // logo are repeated here because Google expects them on the publisher + $org = config('seo.organization'); + $home = rtrim(url('/'), '/') . '/'; $publisher = [ '@type' => 'NewsMediaOrganization', - '@id' => rtrim(url('/'), '/') . '/#organization', - 'name' => 'GOOI&meer', - 'url' => url('/'), + '@id' => $home . '#organization', + 'name' => $org['name'], + 'url' => $home, 'logo' => [ '@type' => 'ImageObject', - 'url' => url('/android-chrome-512x512.png'), - 'width' => 512, - 'height' => 512, + 'url' => url($org['logo']), + 'width' => $org['logo_width'], + 'height' => $org['logo_height'], ], ]; @@ -38,6 +42,7 @@ '@type' => 'NewsArticle', '@id' => $canonical . '#article', 'mainEntityOfPage' => ['@type' => 'WebPage', '@id' => $canonical], + 'isPartOf' => ['@id' => $home . '#website'], 'url' => $canonical, 'headline' => mb_substr($news->plainTitle(), 0, 110), 'description' => $news->summary(200), diff --git a/resources/views/partial/site_jsonld.blade.php b/resources/views/partial/site_jsonld.blade.php new file mode 100644 index 00000000..cf8de1ea --- /dev/null +++ b/resources/views/partial/site_jsonld.blade.php @@ -0,0 +1,69 @@ +{{-- + Site-wide structured data (schema.org JSON-LD): GOOI&meer as a + NewsMediaOrganization and the WebSite with its search. Included on every + page; news articles refer to the organization by its @id. + Values: config/seo.php +--}} +@php + $org = config('seo.organization'); + $home = rtrim(url('/'), '/') . '/'; + + $organization = [ + '@type' => 'NewsMediaOrganization', + '@id' => $home . '#organization', + 'name' => $org['name'], + 'alternateName' => $org['alternate_names'], + 'url' => $home, + 'logo' => [ + '@type' => 'ImageObject', + 'url' => url($org['logo']), + 'width' => $org['logo_width'], + 'height' => $org['logo_height'], + ], + 'address' => [ + '@type' => 'PostalAddress', + 'streetAddress' => $org['address']['street'], + 'postalCode' => $org['address']['postal_code'], + 'addressLocality' => $org['address']['locality'], + 'addressCountry' => $org['address']['country'], + ], + 'telephone' => $org['telephone'], + 'email' => $org['email'], + 'contactPoint' => [ + '@type' => 'ContactPoint', + 'contactType' => 'redactie', + 'telephone' => $org['telephone'], + 'email' => $org['email'], + 'availableLanguage' => 'nl', + ], + 'identifier' => [ + '@type' => 'PropertyValue', + 'propertyID' => 'KvK', + 'value' => $org['kvk'], + ], + 'sameAs' => $org['same_as'], + 'masthead' => url($org['masthead']), + 'actionableFeedbackPolicy' => url($org['feedback_policy']), + ]; + + $website = [ + '@type' => 'WebSite', + '@id' => $home . '#website', + 'url' => $home, + 'name' => $org['name'], + 'alternateName' => $org['alternate_names'], + 'inLanguage' => 'nl-NL', + 'publisher' => ['@id' => $home . '#organization'], + 'potentialAction' => [ + '@type' => 'SearchAction', + 'target' => [ + '@type' => 'EntryPoint', + 'urlTemplate' => url('/nieuws/zoeken') . '/{search_term_string}', + ], + 'query-input' => 'required name=search_term_string', + ], + ]; + + $jsonld = ['@context' => 'https://schema.org', '@graph' => [$organization, $website]]; +@endphp +