bludit/bl-themes/alternative/php/navbar.php

48 lines
1.6 KiB
PHP

<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark text-uppercase">
<div class="container">
<a class="navbar-brand" href="<?php echo $site->url(); ?>">
<span class="text-white"><?php echo $site->title(); ?></span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<!-- Static pages -->
<?php foreach ($staticContent as $staticPage): ?>
<li class="nav-item">
<a class="nav-link" href="<?php echo $staticPage->permalink(); ?>"><?php echo $staticPage->title(); ?></a>
</li>
<?php endforeach ?>
<!-- Social Networks -->
<?php
$socialNetworks = array(
// Key => Label
'github'=>'Github',
'twitter'=>'Twitter',
'facebook'=>'Facebook',
'googleplus'=>'Google Plus',
'instagram'=>'Instagram',
'codepen'=>'Codepen',
'linkedin'=>'Linkedin'
);
?>
<?php foreach ($socialNetworks as $key=>$label): ?>
<?php if ($site->{$key}()): ?>
<li class="nav-item">
<a class="nav-link" href="<?php echo $site->{$key}(); ?>" target="_blank">
<img class="d-none d-sm-block nav-svg-icon" src="<?php echo DOMAIN_THEME.'img/'.$key.'.svg' ?>" alt="icon" />
<span class="d-inline d-sm-none"><?php echo $label; ?></span>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
</div>
</nav>