<?php
$services = [
    'cryptpad' => ['fa' => 'sticky-note', 'url' => 'https://pad.tildeverse.org'],
    'forum' => ['fa' => 'comment', 'url' => 'https://bbj.tildeverse.org'],
    'gitea' => ['fa' => 'code-fork', 'url' => 'https://tildegit.org/team'],
    'gemini' => ['fa' => 'gem', 'url' => 'gemini://tilde.team'],
    'gopher' => ['fa' => 'floppy-o', 'url' => 'gopher://tilde.team'],
    'irc' => ['fa' => 'comments-o', 'url' => '/wiki/irc'],
    'mastodon' => ['fa' => 'retweet', 'url' => 'https://tilde.zone'],
    'nextcloud' => ['fa' => 'cloud', 'url' => 'https://cloud.tilde.team/'],
    'nullpointer' => ['fa' => 'file-code-o', 'url' => 'https://ttm.sh'],
    'pastebin' => ['fa' => 'paste', 'url' => 'https://paste.tildeverse.org/'],
    'webmail' => ['fa' => 'envelope', 'url' => 'https://mail.tilde.team/'],
    'webring' => ['fa' => 'life-ring', 'url' => '/ring/'],
    'xmpp' => ['fa' => 'xmpp', 'url' => '/wiki/xmpp'],
];

$nav = isset($navbar) && $navbar;
unset($navbar);

foreach ($services as $name => $service) {
    if ($nav) { ?>
    <li><a href="<?=$service["url"]?>" role="menuitem"><?=$name?></a></li>
    <?php } else { ?>
    <a href="<?=$service["url"]?>" class="btn btn-default"><?=$name?></a>
    <?php }
}

