You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sessioncommunities.online/sites/+components/communities-json-ld.php

41 lines
964 B
PHP

<?php
/**
* \file
* Generate structured JSON-LD site data.
*/
require_once '+getenv.php';
require_once 'php/assets/room-icons.php';
/**
* @var CommunityRoom[] $rooms
*/
$json_ld_data = array(
'@context' => 'https://schema.org/',
'@id' => $SITE_CANONICAL_URL,
'url' => $SITE_CANONICAL_URL,
'description' => 'Up-to-date list of public groups in Session Messenger.',
'name' => 'Session Communities List',
'@type' => 'WebSite',
'additionalType' => 'Collection',
'image' => "$SITE_CANONICAL_URL/favicon.svg",
'isAccessibleForFree' => true,
'maintainer' => array(
'@type' => 'Person',
'name' => 'gravel',
'sameAs' => "https://codeberg.org/gravel",
),
'potentialAction' => array(
'@type' => 'SearchAction',
'target' => "$SITE_CANONICAL_URL/#q={search_term_string}",
'query-input' => 'required name=search_term_string'
),
);
?>
<script type="application/ld+json">
<?=json_encode($json_ld_data)?>
</script>