mirror of
https://github.com/ItsDrike/itsdrike.com.git
synced 2024-11-09 21:49:41 +00:00
Add basic navbar
This commit is contained in:
parent
151423681d
commit
4b002e6734
|
@ -9,6 +9,7 @@
|
||||||
<title>{{ partial "title-item.html" . }}{{ .Site.Title }}</title>
|
<title>{{ partial "title-item.html" . }}{{ .Site.Title }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
{{ partial "navbar.html" . }}
|
||||||
{{ block "main" . }}{{ end }}
|
{{ block "main" . }}{{ end }}
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "footer.html" . }}
|
||||||
|
|
||||||
|
|
30
layouts/partials/navbar.html
Normal file
30
layouts/partials/navbar.html
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<nav class="navbar navbar-expand-sm navbar-dark">
|
||||||
|
<!-- Navbar home -->
|
||||||
|
<a class="navbar-brand" href="{{ ref . "/" }}">
|
||||||
|
<code>/home/{{ lower .Site.Title }}</code>
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
|
<!-- Left side of the Navbar -->
|
||||||
|
<ul class="navbar-nav mr-auto">
|
||||||
|
<!-- Navbar pages -->
|
||||||
|
{{ $home := .Site.GetPage "home" }}
|
||||||
|
|
||||||
|
{{ $pages := where .Site.RegularPages.ByTitle "Section" "" }}
|
||||||
|
{{ $nav_pages := union $pages .Site.Sections }}
|
||||||
|
|
||||||
|
{{ $nav_pages = where $nav_pages "Params.hidden_from_navbar" "!=" true }}
|
||||||
|
|
||||||
|
{{ range sort $nav_pages "LinkTitle" }}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{{ .RelPermalink }}" class="nav-link">
|
||||||
|
<code>~/{{ urlize .LinkTitle }}</code>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</nav>
|
|
@ -7,6 +7,7 @@ $paragraph-margin-bottom: $headings-margin-bottom * 0.85;
|
||||||
|
|
||||||
@import "node_modules/bootstrap/scss/bootstrap";
|
@import "node_modules/bootstrap/scss/bootstrap";
|
||||||
|
|
||||||
|
$navbar-height: 40px;
|
||||||
$body-color: $gray-300;
|
$body-color: $gray-300;
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
|
|
Loading…
Reference in a new issue