SEO Update
This commit is contained in:
+15
-1
@@ -56,6 +56,20 @@ function make_slug(string $title, string $date): string {
|
||||
return $t . '-' . $date;
|
||||
}
|
||||
|
||||
function event_path(array $event): string {
|
||||
if (!empty($event['slug'])) {
|
||||
return '/event.php?slug=' . rawurlencode($event['slug']);
|
||||
}
|
||||
if (!empty($event['id'])) {
|
||||
return '/event.php?id=' . rawurlencode($event['id']);
|
||||
}
|
||||
return '/event.php';
|
||||
}
|
||||
|
||||
function event_url(array $event): string {
|
||||
return rtrim(BASE_URL, '/') . event_path($event);
|
||||
}
|
||||
|
||||
function sanitize_text(string $s): string {
|
||||
return trim($s);
|
||||
}
|
||||
@@ -103,6 +117,7 @@ function render_event_jsonld_graph(array $events): string {
|
||||
$graph[] = array_filter([
|
||||
"@type" => "Event",
|
||||
"name" => $e['title'],
|
||||
"url" => event_url($e),
|
||||
"startDate" => $start,
|
||||
"eventStatus" => "https://schema.org/EventScheduled",
|
||||
"eventAttendanceMode" => "https://schema.org/OfflineEventAttendanceMode",
|
||||
@@ -214,4 +229,3 @@ function render_rich_text(string $input): string {
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user