Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57f2a1ee45 | ||
|
|
129efb2857 | ||
|
|
69bd0ba66a | ||
|
|
dbbdca504e |
No files matched your search
@@ -41,6 +41,8 @@ class NewsController extends Controller
|
||||
} elseif (isset($apiResult->source->blocks)) {
|
||||
$newsItem->content = $apiResult->source->blocks;
|
||||
}
|
||||
// Dates, author and content may have changed above
|
||||
$newsItem->buildMetadata();
|
||||
return view('newsitem', array_merge($this->getSidebareData(), ['type' => $apiResult->type, 'news' => $newsItem, 'metadata' => $newsItem->metadata, 'searchURL' => 'nieuws/zoeken']));
|
||||
}
|
||||
}
|
||||
|
||||
+35
-7
@@ -1,35 +1,63 @@
|
||||
<?php
|
||||
namespace Model;
|
||||
|
||||
/**
|
||||
* Open Graph / article meta tags for a page.
|
||||
*
|
||||
* Properties are stored without prefix and rendered as og:<prop>, except
|
||||
* namespaced ones (e.g. article:published_time), which are rendered as-is.
|
||||
* A value can be an array to render the same property multiple times
|
||||
* (e.g. article:tag).
|
||||
*/
|
||||
class MetaData {
|
||||
private $data = ['type' => 'article', 'locale' => 'nl-nl'];
|
||||
private $data = ['type' => 'article', 'locale' => 'nl_NL'];
|
||||
|
||||
public function set($prop, $val) {
|
||||
if($val) {
|
||||
$this->data[$prop] = $val;
|
||||
$this->data[$prop] = self::clean($val);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get($prop, $default = null) {
|
||||
return $this->data[$prop] ?? $default;
|
||||
}
|
||||
|
||||
public function append($prop, $val) {
|
||||
if(array_key_exists($prop, $this->data)) {
|
||||
if(array_key_exists($prop, $this->data) && is_string($this->data[$prop])) {
|
||||
$this->data[$prop] .= $val;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefix a relative value (e.g. an image path) with a base URL.
|
||||
* Absolute URLs are left alone.
|
||||
*/
|
||||
public function prepend($prop, $val) {
|
||||
if(array_key_exists($prop, $this->data)) {
|
||||
if(array_key_exists($prop, $this->data) && is_string($this->data[$prop])
|
||||
&& !preg_match('#^(https?:)?//#i', $this->data[$prop])) {
|
||||
$this->data[$prop] = $val . $this->data[$prop];
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function metaTags() {
|
||||
foreach($this->data as $prop => $val) {
|
||||
if($val) {
|
||||
echo "<meta property=\"og:$prop\" content=\"" . htmlentities($val) . "\" />\n";
|
||||
foreach($this->data as $prop => $values) {
|
||||
$name = strpos($prop, ':') !== false && strpos($prop, 'image:') !== 0 ? $prop : "og:$prop";
|
||||
foreach((array)$values as $val) {
|
||||
if($val) {
|
||||
echo "<meta property=\"$name\" content=\"" . htmlspecialchars($val, ENT_QUOTES, 'UTF-8') . "\" />\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Collapse whitespace (newlines, tabs) in text values. */
|
||||
private static function clean($val) {
|
||||
if(is_array($val)) {
|
||||
return array_values(array_filter(array_map([self::class, 'clean'], $val)));
|
||||
}
|
||||
return is_string($val) ? trim(preg_replace('/\s+/u', ' ', $val)) : $val;
|
||||
}
|
||||
}
|
||||
+100
-5
@@ -96,15 +96,110 @@ class NewsItem extends Model {
|
||||
}
|
||||
|
||||
$this->url = "/nieuws/{$this->id}/" . parent::url_slug($this->title);
|
||||
$this->buildMetadata();
|
||||
}
|
||||
|
||||
/**
|
||||
* (Re)build the Open Graph / article metadata. Call again after changing
|
||||
* the content, dates or author (e.g. for API v2 articles).
|
||||
*/
|
||||
public function buildMetadata() {
|
||||
$images = $this->imageList();
|
||||
$tags = $this->tagTitles();
|
||||
$this->metadata = (new MetaData())
|
||||
->set('title', $this->title)
|
||||
->set('description', strip_tags($this->excerpt()))
|
||||
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
|
||||
->set('title', $this->plainTitle())
|
||||
->set('description', $this->summary(200))
|
||||
->set('image', $images ? $images[0]['url'] : null)
|
||||
->set('image:alt', $images ? $images[0]['title'] : null)
|
||||
->set('video', isset($this->video) ? $this->video : null)
|
||||
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
|
||||
->set('article:published_time', $this->published->format('r'))
|
||||
->set('article:modified_time', $this->edited ? $this->edited->format('r') : null)
|
||||
->set('article:published_time', $this->published ? $this->published->format(DATE_ATOM) : null)
|
||||
->set('article:modified_time', $this->edited ? $this->edited->format(DATE_ATOM) : null)
|
||||
->set('article:section', $tags ? $tags[0] : null)
|
||||
->set('article:tag', $tags)
|
||||
;
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
/** The title without HTML tags or entities. */
|
||||
public function plainTitle() {
|
||||
return self::normalizeText((string)$this->title);
|
||||
}
|
||||
|
||||
/** Titles of the article's tags (mostly places, e.g. 'Hilversum'). */
|
||||
public function tagTitles() {
|
||||
$titles = [];
|
||||
foreach((is_array($this->tags) ? $this->tags : []) as $tag) {
|
||||
if(isset($tag->titel) && $tag->titel) {
|
||||
$titles[] = $tag->titel;
|
||||
}
|
||||
}
|
||||
return $titles;
|
||||
}
|
||||
|
||||
/** Plain text of the article; works for HTML content and API v2 content blocks. */
|
||||
public function plainText() {
|
||||
if(is_string($this->content)) {
|
||||
return self::normalizeText($this->content);
|
||||
}
|
||||
$parts = [];
|
||||
foreach((is_array($this->content) ? $this->content : []) as $block) {
|
||||
if(in_array($block->type ?? '', ['intro', 'paragraph', 'text', 'header'])) {
|
||||
$parts[] = $block->data->text ?? $block->text ?? '';
|
||||
}
|
||||
}
|
||||
return self::normalizeText(implode(' ', $parts));
|
||||
}
|
||||
|
||||
/** Short plain-text summary (for meta descriptions), cut at a word boundary. */
|
||||
public function summary($maxLength = 160) {
|
||||
$text = $this->plainText();
|
||||
if(mb_strlen($text) <= $maxLength) {
|
||||
return $text;
|
||||
}
|
||||
$cut = mb_substr($text, 0, $maxLength);
|
||||
$space = mb_strrpos($cut, ' ');
|
||||
return rtrim(mb_substr($cut, 0, $space ?: $maxLength), " ,.;:-") . '…';
|
||||
}
|
||||
|
||||
/**
|
||||
* The article's images as ['url' => ..., 'title' => ..., 'own' => bool].
|
||||
* Own images ('own' => true) have a URL relative to the image base
|
||||
* (IMAGE_BASE_URL); embedded (v2) images get an absolute URL.
|
||||
*/
|
||||
public function imageList() {
|
||||
$list = [];
|
||||
foreach((is_array($this->images) ? $this->images : []) as $image) {
|
||||
$list[] = ['url' => $image->url, 'title' => $image->title ?? null, 'own' => true];
|
||||
}
|
||||
foreach((is_array($this->content) ? $this->content : []) as $block) {
|
||||
$type = $block->type ?? '';
|
||||
if($type == 'headerRichA' && isset($block->data->image)) {
|
||||
$image = $block->data->image;
|
||||
$url = isset($image->crops) ? ($image->crops->{'16:9'}->{'1600'} ?? null) : ($image->crop ?? null);
|
||||
$list[] = ['url' => $url, 'title' => $image->title ?? null];
|
||||
} elseif(in_array($type, ['headerRichA', 'image']) && isset($block->image->url)) {
|
||||
$list[] = ['url' => $block->image->url, 'title' => $block->image->title ?? null];
|
||||
} elseif($type == 'image' && isset($block->data->url)) {
|
||||
$list[] = ['url' => '/' . ltrim($block->data->url, '/'), 'title' => $block->data->title ?? null];
|
||||
}
|
||||
}
|
||||
$list = array_values(array_filter($list, function($image) { return $image['url']; }));
|
||||
foreach($list as &$image) {
|
||||
if(!isset($image['own'])) {
|
||||
$image['own'] = false;
|
||||
if(!preg_match('#^(https?:)?//#i', $image['url'])) {
|
||||
$image['url'] = url($image['url']);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
private static function normalizeText($html) {
|
||||
$html = preg_replace('#<br\s*/?>|</p>|</h[1-6]>#i', ' ', $html);
|
||||
$text = html_entity_decode(strip_tags($html), ENT_QUOTES | ENT_HTML5, 'UTF-8');
|
||||
return trim(preg_replace('/\s+/u', ' ', $text));
|
||||
}
|
||||
|
||||
public function excerpt() {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Organization details for structured data (schema.org)
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Used for the NewsMediaOrganization / WebSite JSON-LD on every page and as
|
||||
| the publisher of news articles. URLs are relative to the site (APP_URL /
|
||||
| current host); add more profiles to 'same_as' when available.
|
||||
|
|
||||
*/
|
||||
|
||||
return [
|
||||
'organization' => [
|
||||
'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',
|
||||
],
|
||||
];
|
||||
@@ -10,7 +10,7 @@ Neem contact op
|
||||
<ul class="bread_crumb">
|
||||
<li><a title="Home" href="/">Home</a></li>
|
||||
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
|
||||
<li><a title="GOOI&meer" href="{{route('contact')}}">GOOI&meer</a></li>
|
||||
<li><a title="NH Gooi" href="{{route('contact')}}">NH Gooi</a></li>
|
||||
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
|
||||
<li>Neem contact op</li>
|
||||
</ul>
|
||||
@@ -95,4 +95,4 @@ Neem contact op
|
||||
|
||||
@push('scripts')
|
||||
{!! FriendlyCaptcha::renderWidgetScripts() !!}
|
||||
@endpush
|
||||
@endpush
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
<h2 class="page_margin_top">GOOI&meer helpt u kiezen!</h2>
|
||||
<h2 class="page_margin_top">NH Gooi helpt u kiezen!</h2>
|
||||
|
||||
<p>Volg bij GOOI&meer wat partijen in uw gemeente te vertellen hebben.</p>
|
||||
<p>Volg bij NH Gooi wat partijen in uw gemeente te vertellen hebben.</p>
|
||||
<p>De volgende debatten waren live te volgen op <a href="{{$live = route('luister.live')}}" class="player"><span class="fa fa-play"></span> <span>NH Gooi Radio</span></a>.</p>
|
||||
|
||||
<table id="overzicht">
|
||||
@@ -20,7 +20,7 @@
|
||||
<tr>
|
||||
<td>Laren</th>
|
||||
<td>Zondag 6 maart van 14:00 uur tot 16:00 uur</td>
|
||||
<td><a href="/gemist/fragment/1294662/verkiezingsdebat-laren.mp3"><span class="fa fa-history"></span> <span>Luister terug</span></a></td>
|
||||
<td><a href="/gemist/fragment/1294662/verkiezingsdebat-laren.mp3"><span class="fa fa-history"></span> <span>Luister terug</span></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Huizen</th>
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
|
||||
#overzicht td {
|
||||
color: #000;
|
||||
color: #000;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<head>
|
||||
@include('layouts._analytics')
|
||||
<title>@yield('title') | GOOI&meer</title>
|
||||
<title>{!! trim($__env->yieldContent('title')) !!} | GOOI&meer</title>
|
||||
<!--meta-->
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.2" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="keywords" content="GOOI&meer,Radio,TV,Nieuws,Lokale omroep,Huizen,Blaricum,Eemnes,Laren,Hilversum,BEL-gemeenten,Streekomroep" />
|
||||
<meta name="description" content="GOOI&meer is de streekomroep voor Hilversum, Huizen, Blaricum, Eemnes en Laren." />
|
||||
<meta name="description" content="{{ (isset($metadata) && $metadata->get('description')) ? $metadata->get('description') : 'GOOI&meer is de streekomroep voor Hilversum, Huizen, Blaricum, Eemnes en Laren.' }}" />
|
||||
{{-- Allow large image previews (Google Discover, Top Stories) --}}
|
||||
<meta name="robots" content="max-image-preview:large" />
|
||||
<link rel="canonical" href="{{ url()->current() }}" />
|
||||
<!--style-->
|
||||
<link href='//fonts.googleapis.com/css?family=Roboto:300,400,700' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700' rel='stylesheet' type='text/css'>
|
||||
@@ -35,6 +37,9 @@
|
||||
->append('title', ' | GOOI&meer')
|
||||
->metaTags();
|
||||
} ?>
|
||||
<meta name="twitter:card" content="{{ (isset($metadata) && $metadata->get('image')) ? 'summary_large_image' : 'summary' }}" />
|
||||
@include('partial/site_jsonld')
|
||||
@stack('head')
|
||||
@stack('styles')
|
||||
<link rel="icon" href="/favicon.ico" sizes="48x48">
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="nl">
|
||||
@include('layouts._head')
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@yield('content')
|
||||
@endsection
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="nl">
|
||||
@include('layouts._head')
|
||||
<body>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
@@ -13,7 +13,7 @@
|
||||
</noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
<div class="site_container boxed @yield('site_container_class')">
|
||||
<div class="menu_mobile_container d-flex d-md-none sticky clearfix">
|
||||
<header class="menu_mobile_container d-flex d-md-none sticky clearfix">
|
||||
<div class="mobile_menu_button">
|
||||
<a href="javascript:void(0)"><i class="fa-solid fa-bars"></i></a>
|
||||
</div>
|
||||
@@ -43,9 +43,9 @@
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="menu_container sticky clearfix">
|
||||
<div class="top_menu_container d-none d-md-flex">
|
||||
<header class="top_menu_container d-none d-md-flex">
|
||||
<a class="brand_logo" href="{{url('/')}}"><img src="/images/brand/logo-offwhite-payoff.svg" alt="GOOI&meer - Alles wat de streek beweegt"/></a>
|
||||
<ul class="right_menu">
|
||||
<li>
|
||||
@@ -70,7 +70,7 @@
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
@include('widgets.menu')
|
||||
</div>
|
||||
|
||||
@@ -82,13 +82,14 @@
|
||||
|
||||
<!-- Content -->
|
||||
|
||||
<div class="page @yield('page_container_class')">
|
||||
{{-- The page content is the <main>, unless a layout/page marks its own <main> (and <aside>) with @section('page_tag', 'div') --}}
|
||||
<@yield('page_tag', 'main') class="page @yield('page_container_class')">
|
||||
<a name="top"></a>
|
||||
@yield('page')
|
||||
</div><!--/.page-->
|
||||
</@yield('page_tag', 'main')><!--/.page-->
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="footer_container">
|
||||
<footer class="footer_container">
|
||||
<div class="footer_menu">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-3">
|
||||
@@ -140,9 +141,9 @@
|
||||
</ul>
|
||||
<ul class="footer_social_media">
|
||||
<li><a class="facebook" title="Facebook" target="_blank"
|
||||
href="https://www.facebook.com/WijZijnNHGooi">Facebook</a>
|
||||
href="https://www.facebook.com/WijZijnGOOIenMeer">Facebook</a>
|
||||
</li>
|
||||
<li><a class="twitter-x" title="Twitter/X" target="_blank" href="https://twitter.com/nhgooi">Twitter</a>
|
||||
<li><a class="instagram" title="Instagram" target="_blank" href="https://instagram.com/gooi.en.meer">Instagram</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -152,7 +153,7 @@
|
||||
© GOOI&meer
|
||||
<a class="scroll_top" href="#top" title="Scroll to top"><i class="fa-solid fa-angle-up"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<nav class="mobile_tabbar d-md-none" aria-label="Hoofdnavigatie">
|
||||
<a href="{{url('/')}}" class="{{ request()->is('/') || request()->is('nieuws*') ? 'active' : '' }}"><i class="fa-regular fa-newspaper"></i><span>Nieuws</span></a>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
@extends('layouts/master')
|
||||
|
||||
{{-- This layout has its own <main> (content) and <aside> (sidebar) --}}
|
||||
@section('page_tag', 'div')
|
||||
|
||||
@section('content_class')
|
||||
box
|
||||
@endsection
|
||||
@@ -10,16 +13,17 @@
|
||||
<div class="col-12">
|
||||
@yield('breadcrumb_top')
|
||||
</div>
|
||||
<div class="col-12 col-md content_container">
|
||||
<div class="full-width md_margin_top @yield('content_class')">
|
||||
<main class="col-12 col-md content_container">
|
||||
{{-- Pages can make this an <article> with @section('content_tag', 'article') --}}
|
||||
<@yield('content_tag', 'div') class="full-width md_margin_top @yield('content_class')">
|
||||
@yield('breadcrumb')
|
||||
@yield('tags')
|
||||
<h1 class="page_title">@yield('title')</h1>
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</@yield('content_tag', 'div')>
|
||||
</main>
|
||||
|
||||
<div class="col-12 col-md-auto sidebar">
|
||||
<aside aria-label="Meer van GOOI&meer" class="col-12 col-md-auto sidebar">
|
||||
@section('sidebar')
|
||||
@if ((isset($populair) && $populair) || isset($newsItems) && $newsItems)
|
||||
<div data-tabs>
|
||||
@@ -64,7 +68,7 @@
|
||||
|
||||
@include('widgets/contact', [])
|
||||
@show
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
GOOI&meer - Nieuws
|
||||
@endsection
|
||||
|
||||
{{-- This page has its own <main> (news list) and <aside> (sidebar) --}}
|
||||
@section('page_tag', 'div')
|
||||
|
||||
@section('page_container_class')
|
||||
news
|
||||
@endsection
|
||||
@@ -98,7 +101,7 @@
|
||||
{{-- body --}}
|
||||
<div class="grey_background">
|
||||
<div class="body_container row">
|
||||
<div class="col-12 col-md content_container">
|
||||
<main class="col-12 col-md content_container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-12">
|
||||
<div class="d-flex">
|
||||
@@ -124,9 +127,9 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="col-12 col-md-auto sidebar">
|
||||
<aside aria-label="Meer van GOOI&meer" class="col-12 col-md-auto sidebar">
|
||||
@include('widgets/gooienmeerradiotv', ['headerClass' => 'small'])
|
||||
|
||||
@include('widgets.banner_sidebar')
|
||||
@@ -139,7 +142,7 @@
|
||||
@include('partial/podcastitems', ['showTime' => false, 'showImage' => false, 'podcasts' => $podcasts, 'isPodcast' => false])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
|
||||
@section('page_class')news_post post_container @endsection
|
||||
|
||||
{{-- The article itself is an <article> element (title, details and text) --}}
|
||||
@section('content_tag', 'article')
|
||||
|
||||
@push('head')
|
||||
@include('partial/news_jsonld', ['news' => $news])
|
||||
@endpush
|
||||
|
||||
@section('breadcrumb')
|
||||
<ul class="bread_crumb">
|
||||
<li><a title="Home" href="/">Home</a></li>
|
||||
@@ -32,13 +39,10 @@
|
||||
<ul class="post_details clearfix">
|
||||
<li class="detail date">
|
||||
<i class="fa-regular fa-clock"></i>
|
||||
{{Formatter::relativeDate($news->published)}} om {{$news->published->format('H:i')}}
|
||||
<time datetime="{{$news->published->format(DATE_ATOM)}}">{{Formatter::relativeDate($news->published)}} om {{$news->published->format('H:i')}}</time>
|
||||
@if($news->edited && ($news->edited->format('d m H i') != $news->published->format('d m H i')))
|
||||
| bijgewerkt:
|
||||
@if($news->edited->format('d m') != $news->published->format('d m'))
|
||||
{{strtolower(Formatter::relativeDate($news->edited))}}
|
||||
@endif
|
||||
om {{$news->edited->format('H:i')}} uur
|
||||
<time datetime="{{$news->edited->format(DATE_ATOM)}}">@if($news->edited->format('d m') != $news->published->format('d m')){{strtolower(Formatter::relativeDate($news->edited))}} @endif om {{$news->edited->format('H:i')}} uur</time>
|
||||
@endif
|
||||
</li>
|
||||
@if($news->author)
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
{{--
|
||||
Structured data (schema.org JSON-LD) for a news article: NewsArticle with
|
||||
GOOI&meer as publisher, and the breadcrumb. Used by search engines (Google
|
||||
News / Top Stories) and AI assistants to understand the article.
|
||||
--}}
|
||||
@php
|
||||
$canonical = url()->current();
|
||||
$absolute = function ($image) use ($imgBase) {
|
||||
return $image['own'] ? $imgBase . $image['url'] : $image['url'];
|
||||
};
|
||||
$images = array_map($absolute, $news->imageList());
|
||||
$tags = $news->tagTitles();
|
||||
|
||||
// "Saskia Plokker, Bart Koomen" / "A en B" -> separate authors;
|
||||
// an affiliation in brackets ("Elsa Poorthuis (Gooi & Meer)") is dropped
|
||||
$authors = [];
|
||||
$authorText = preg_replace('/\s*\([^)]*\)/u', '', trim(strip_tags((string) $news->author)));
|
||||
foreach (preg_split('/\s*(?:,|\s&\s|\s+en\s+)\s*/u', $authorText) as $name) {
|
||||
if ($name !== '') {
|
||||
$authors[] = ['@type' => 'Person', 'name' => $name];
|
||||
}
|
||||
}
|
||||
|
||||
// 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' => $home . '#organization',
|
||||
'name' => $org['name'],
|
||||
'url' => $home,
|
||||
'logo' => [
|
||||
'@type' => 'ImageObject',
|
||||
'url' => url($org['logo']),
|
||||
'width' => $org['logo_width'],
|
||||
'height' => $org['logo_height'],
|
||||
],
|
||||
];
|
||||
|
||||
$article = array_filter([
|
||||
'@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),
|
||||
'image' => $images ?: null,
|
||||
'datePublished' => $news->published ? $news->published->format(DATE_ATOM) : null,
|
||||
'dateModified' => ($news->edited ?: $news->published) ? ($news->edited ?: $news->published)->format(DATE_ATOM) : null,
|
||||
'author' => $authors ?: $publisher,
|
||||
'publisher' => $publisher,
|
||||
'articleSection' => $tags[0] ?? null,
|
||||
'keywords' => $tags ? implode(', ', $tags) : null,
|
||||
'inLanguage' => 'nl-NL',
|
||||
'isAccessibleForFree' => true,
|
||||
]);
|
||||
|
||||
$breadcrumb = [
|
||||
'@type' => 'BreadcrumbList',
|
||||
'itemListElement' => [
|
||||
['@type' => 'ListItem', 'position' => 1, 'name' => 'Home', 'item' => url('/')],
|
||||
['@type' => 'ListItem', 'position' => 2, 'name' => 'Nieuws', 'item' => route('nieuws')],
|
||||
['@type' => 'ListItem', 'position' => 3, 'name' => $news->plainTitle(), 'item' => $canonical],
|
||||
],
|
||||
];
|
||||
|
||||
$jsonld = ['@context' => 'https://schema.org', '@graph' => [$article, $breadcrumb]];
|
||||
@endphp
|
||||
<script type="application/ld+json">{!! json_encode($jsonld, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_PRETTY_PRINT) !!}</script>
|
||||
@@ -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
|
||||
<script type="application/ld+json">{!! json_encode($jsonld, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_PRETTY_PRINT) !!}</script>
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto sidebar">
|
||||
<aside aria-label="Meer van GOOI&meer" class="col-12 col-md-auto sidebar">
|
||||
|
||||
@if ((isset($podcasts)))
|
||||
<div data-tabs>
|
||||
@@ -177,7 +177,7 @@
|
||||
@endif
|
||||
|
||||
@include('widgets.banner_sidebar')
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@@ -91,7 +91,7 @@
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto sidebar">
|
||||
<aside aria-label="Meer van GOOI&meer" class="col-12 col-md-auto sidebar">
|
||||
@if ((isset($podcasts)))
|
||||
<div data-tabs>
|
||||
<div class="tabs">
|
||||
@@ -111,7 +111,7 @@
|
||||
@endif
|
||||
|
||||
@include('widgets.banner_sidebar')
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-12 col-md-auto sidebar">
|
||||
<aside aria-label="Meer van GOOI&meer" class="col-12 col-md-auto sidebar">
|
||||
|
||||
@if (isset($podcasts) && count($podcasts) > 2)
|
||||
<div data-tabs>
|
||||
@@ -74,7 +74,7 @@
|
||||
@endif
|
||||
|
||||
@include('widgets.banner_sidebar')
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto sidebar">
|
||||
<aside aria-label="Meer van GOOI&meer" class="col-12 col-md-auto sidebar">
|
||||
@if ((isset($programs)))
|
||||
<div data-tabs>
|
||||
<div class="tabs">
|
||||
@@ -110,7 +110,7 @@
|
||||
@endif
|
||||
|
||||
@include('widgets.banner_sidebar')
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
$pixelsPerHour = 30;
|
||||
$border = 1;
|
||||
$margin = 2;
|
||||
?>
|
||||
|
||||
@extends('layouts/full')
|
||||
|
||||
@section('title')
|
||||
Radioprogrammering
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<p style="border: red 1px dotted; padding: 1px; color: red;">
|
||||
Ook bij NH Gooi is de hoogste prioriteit momenteel de gezondheid van onze medewerkers en gasten. <br/>
|
||||
In overleg met de programmamakers worden sommige muziekprogramma's vervangen door herhalingen of komen deze te vervallen. Onze nieuwsuitzendingen zoals het regionieuws op het halve uur en de NH Gooi Zaterdag vinden zoveel mogelijk doorgang, waar nodig in aangepaste vorm. <br/>
|
||||
Het onderstaande schema wordt zoveel mogelijk actueel gehouden.
|
||||
</p>
|
||||
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
<li class="action_button previous-week"><a href="{{route('radio.gids', ($shift - 1))}}">← Week eerder</a></li>
|
||||
<li class="action_button current-week"><a href="{{route('radio.gids')}}">Deze week</a></li>
|
||||
<li class="action_button next-week"><a href="{{route('radio.gids', ($shift + 1))}}">Week later →</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div id="loading" style="display: none; height: 300px;">
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
|
||||
<b>Programmaschema ophalen...</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='schedule'>
|
||||
@include('partial/radioscheduleweek', ['schedule' => $schedule])
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
<li class="action_button previous-week"><a href="{{route('radio.gids', ($shift - 1))}}">← Week eerder</a></li>
|
||||
<li class="action_button current-week"><a href="{{route('radio.gids')}}">Deze week</a></li>
|
||||
<li class="action_button next-week"><a href="{{route('radio.gids', ($shift + 1))}}">Week later →</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
.pager {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.pager .previous-week,
|
||||
.pager .current-week,
|
||||
.pager .next-week {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.pager .current-week {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pager .next-week {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) { /* smaller than desktop */
|
||||
.schedule {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.schedule .time-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.schedule .date-header {
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
height: auto;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.schedule a.program {
|
||||
/* override the style="height.." */
|
||||
height: auto !important;
|
||||
margin-left: 15px !important;
|
||||
margin-bottom: 3px !important;
|
||||
}
|
||||
|
||||
.schedule .program .program-content {
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.schedule .program.non-stop .program-title {
|
||||
background-color: #8F9BA6;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) { /* desktop */
|
||||
.schedule {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.schedule .date-header {
|
||||
height: 3em;
|
||||
text-align: center;
|
||||
font-size: 120%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.schedule .program .program-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.schedule .program .program-title {
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.schedule .program.non-stop .program-title {
|
||||
background-color: transparent;
|
||||
color: #8F9BA6;
|
||||
}
|
||||
}
|
||||
|
||||
.schedule {
|
||||
color: black;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.schedule .time-header {
|
||||
height: {{$pixelsPerHour}}px;
|
||||
}
|
||||
|
||||
.schedule .timeslots {
|
||||
width: 80px;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.schedule .date-column {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.schedule a.program {
|
||||
display: block;
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
margin: {{$margin}}px;
|
||||
border: solid {{$border}}px #03A6E0;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.schedule a.program:hover {
|
||||
color: white;
|
||||
background-color: #71c1de;
|
||||
}
|
||||
|
||||
.schedule .program.current {
|
||||
border-color: #BD0013;
|
||||
}
|
||||
|
||||
.schedule .program .program-times {
|
||||
text-align: center;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
.schedule .program.current .program-title {
|
||||
background-color: #71c1de;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.schedule .program.non-stop {
|
||||
border-color: #6C757D;
|
||||
}
|
||||
|
||||
|
||||
.schedule .program.special {
|
||||
color: #03A6E0;
|
||||
}
|
||||
|
||||
.schedule .program .current-marker {
|
||||
margin: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.schedule .program .current-marker span {
|
||||
padding: 3px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
background-color: #BD0013;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.schedule .program .program-title {
|
||||
padding: 5px;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
background-color: #03A6E0;
|
||||
}
|
||||
|
||||
.schedule .program .program-content {
|
||||
margin: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.schedule .program hr {
|
||||
margin: 3px;
|
||||
border: none;
|
||||
border-top: 1px solid #03A6E0;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function scrollToMiddle($elt) {
|
||||
if($elt.length == 0) { return; }
|
||||
var elem_position = $elt.offset().top;
|
||||
var window_height = $(window).height();
|
||||
var y = elem_position - window_height / 2;
|
||||
window.scrollTo(0,y);
|
||||
}
|
||||
|
||||
$(function() { scrollToMiddle($(".current-marker")); });
|
||||
</script>
|
||||
@endpush
|
||||
Reference in new issue
Block a user