<?php
$services = [
    'chat' => ['fa' => 'comments-o', 'url' => '/wiki/irc'],
    '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'],
    'gopher' => ['fa' => 'floppy-o', 'url' => 'https://gopher.tildeverse.org/tilde.team'],
    '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/'],
];

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

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

