<?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) { ?>
    <?php if ($nav) echo '<li>'; ?>
    <a href="<?=$service['url']?>" <?php if (!$nav) echo 'class="btn btn-default"'; ?>><i class="fa fa-<?=$service['fa']?>"></i> <?=$name?></a>
    <?php if ($nav) echo '</li>' . PHP_EOL; ?>
<?php }

