diff options
author | Ralf Geschke <ralf@kuerbis.org> | 2018-11-07 01:22:07 +0300 |
---|---|---|
committer | Ralf Geschke <ralf@kuerbis.org> | 2018-11-07 01:22:07 +0300 |
commit | 0dd4ccea052e217853999a9cf1f606507304bcc6 (patch) | |
tree | 77cff9d4f6f9f26c6ec740d6e8290f26651b518c | |
parent | d275cd86bdadf950ef9b1a2270087869395ebb6b (diff) |
Add favicon and "brand" logo, set by config variable, display when config is set.
Add active class in menu items which don't have a submenu.
-rw-r--r-- | layouts/partials/head.html | 11 | ||||
-rw-r--r-- | layouts/partials/header.html | 4 | ||||
-rw-r--r-- | static/css/custom.css | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 62f4a1f..d32a1cb 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -14,5 +14,16 @@ {{ end }} <link href="{{ .Site.BaseURL }}css/font-awesome/css/font-awesome.min.css" rel="stylesheet"> <link href="{{ .Site.BaseURL }}css/custom.css" rel="stylesheet"> +{{ if .Site.Params.Favicon }} +<link rel="icon" type="image/x-icon" href="{{ .Site.BaseURL }}{{ .Site.Params.Favicon }}" /> +{{ end }} + +<style> +/* Move down content because we have a fixed navbar that is 50px tall */ + +body { + padding-top: 60px; +} +</style> </head>
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index fa03063..98a0155 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,5 +1,5 @@ <nav class="navbar fixed-top navbar-expand-lg {{ .Site.Params.Navbar.ColorScheme }} {{ .Site.Params.Navbar.BgScheme }}"> - <a class="navbar-brand" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> + <a class="navbar-brand" href="{{ .Site.BaseURL }}">{{ if .Site.Params.Navbar.BrandImage }}<img src="{{ .Site.BaseURL }}{{ .Site.Params.Navbar.BrandImage }}" width="30" height="30" class="d-inline-block align-top" alt=""> {{ end }}{{ .Site.Title }}</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarMain" aria-controls="navbarMain" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> @@ -25,7 +25,7 @@ </li> <span class="mx-2"></span> {{ else }} - <li class="nav-item"> + <li class="nav-item {{ if eq $currentPage.URL .URL }}active{{ end }}"> <a class="nav-link" href="{{ .URL }}"> {{ .Pre }} {{ .Name }} diff --git a/static/css/custom.css b/static/css/custom.css index ff019f0..30e1b2e 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,7 +1,3 @@ -/* Move down content because we have a fixed navbar that is 50px tall */ -body { - padding-top: 60px; -} /* Menu Settings - later... */ .main-nav ul { |