Make navbar brand URL context aware

This commit is contained in:
hossainemruz 2020-06-30 01:51:36 +06:00
parent 5e993f5740
commit b7ac8360cc
3 changed files with 3 additions and 4 deletions

View file

@ -3,7 +3,7 @@
{{ end }}
{{ define "navbar" }}
{{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" true) }}
{{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" true "navBrandURL" .Site.BaseURL ) }}
{{ end }}
{{ define "content" }}

View file

@ -7,7 +7,7 @@
{{ end }}
{{ define "navbar" }}
{{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false) }}
{{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false "navBrandURL" "/posts") }}
{{ end }}
{{ define "content" }}

View file

@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-lg top-navbar final-navbar shadow">
<div class="container">
<a class="navbar-brand" href="{{ .baseURL }}">
<a class="navbar-brand" href="{{ .navBrandURL }}">
<img src="/assets/images/logo.png">
{{- .title -}}
</a>
@ -11,7 +11,6 @@
<div class="collapse navbar-collapse" id="top-nav-items">
<ul class="navbar-nav ml-auto">
</ul>
</ul>
</div>
</div>
</nav>