SEO & JSON-LD
parent
5017933542
commit
74206ae3b6
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
include "$PROJECT_ROOT/php/utils/room-icons.php";
|
||||
|
||||
/**
|
||||
* @var \CommunityRoom[] $rooms
|
||||
*/
|
||||
|
||||
$json_ld_data = array(
|
||||
"@context" => "https://www.w3.org/ns/activitystreams",
|
||||
"summary" => "Active Session Communities",
|
||||
"type" => "Collection",
|
||||
"totalItems" => count($rooms),
|
||||
"items" => array_map(function(\CommunityRoom $room) {
|
||||
$values = array(
|
||||
"type" => "Group",
|
||||
"name" => $room->name,
|
||||
"summary" => $room->description,
|
||||
"startTime" => $room->created ? date('Y-m-d\TH:i:s', intval($room->created)) : null,
|
||||
"url" => $room->get_preview_url(),
|
||||
"icon" => room_icon($room, '64x64')
|
||||
);
|
||||
return array_filter($values, function ($value) {
|
||||
return $value != null;
|
||||
});
|
||||
}, $rooms)
|
||||
);
|
||||
?>
|
||||
|
||||
<script type="application/ld+json">
|
||||
<?=json_encode($json_ld_data)?>
|
||||
</script>
|
Loading…
Reference in New Issue