diff options
author | Derek Severin <severinderek@gmail.com> | 2022-01-23 13:37:57 +0300 |
---|---|---|
committer | Derek Severin <severinderek@gmail.com> | 2022-01-23 13:37:57 +0300 |
commit | 6d8abb4751337c99192cdbfeea00f399be05eb6d (patch) | |
tree | 17597a45a92229fc3b524a20565aeac2f0b573b2 | |
parent | 9d95dc8f7bd12bd31d5d8ea263b96ae28d55cb2f (diff) |
Home + nav logo
-rw-r--r-- | layouts/partials/nav.html | 8 | ||||
-rw-r--r-- | layouts/partials/sections/home.html | 7 | ||||
-rw-r--r-- | static/css/theme.css | 23 |
3 files changed, 34 insertions, 4 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index abca1a2..682f121 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -16,8 +16,12 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - {{ with .Site.Params.navigation.brand }} - <a class="navbar-brand page-scroll" href="#">{{ . | markdownify }}</a> + {{ if .Site.Params.navigation.brand_logo }} + <a class="navbar-brand page-scroll" href="#"> + <img id="brand_logo" src="{{ .Site.Params.navigation.brand_logo }}" class="img-responsive"> + </a> + {{ else if .Site.Params.navigation.brand }} + <a class="navbar-brand page-scroll" href="#">{{ .Site.Params.navigation.brand | markdownify }}</a> {{ end }} </div> {{ "<!-- Get the navigation menu entries and create the links -->" | safeHTML }} diff --git a/layouts/partials/sections/home.html b/layouts/partials/sections/home.html index da2a0f2..97557e9 100644 --- a/layouts/partials/sections/home.html +++ b/layouts/partials/sections/home.html @@ -22,6 +22,9 @@ " > <div class="header-content-inner anim-wrapper"> + {{ with .title_logo }} + <img id="home_logo" src="{{ . }}" class="img-responsive"> + {{ end }} {{ with .title }} {{/* TODO: use specific class for title? */}} <h1 class="anim zoomIn">{{ . | markdownify }}</h1> @@ -29,7 +32,7 @@ {{ with .subtitle }} <h2>{{ . | markdownify }}</h2> {{ end }} - {{ if .title }} + {{ if or .title .subtitle }} <hr class="primary anim zoomIn"> {{ end }} {{ with .text }} @@ -53,7 +56,7 @@ </div> </div> </div> - {{/* Background video (if no image) */}} + {{/* Background video (if no 'background' image) */}} {{- if and .background_video (not .background) -}} <video autoplay muted loop id="home_video"> <source src="{{ printf "images/%s" .background_video }}" type="video/mp4"> diff --git a/static/css/theme.css b/static/css/theme.css index 4d84795..bef760c 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -539,6 +539,22 @@ padding: 2em 2em 2em 2em; color: var(--NAVBAR-FIXED-BRAND-COLOR, var(--GENERAL-FONT-COLOR-2)); } +#brand_logo { + position: absolute; + display: block; +/* + margin-left: auto; + margin-right: auto; +*/ + margin: 0; + top: 50%; + + height: 1em; + + -ms-transform: translateY(-50%); + transform: translateY(-50%); +} + .navbar-default .navbar-header .navbar-brand:hover, .navbar-default .navbar-header .navbar-brand:focus { color: var(--NAVBAR-FIXED-BRAND-HOVER-COLOR, var(--GENERAL-LINK-ACTIVE-COLOR-1)); @@ -724,6 +740,13 @@ main { object-fit: cover; } +#home_logo { + display: block; + margin-left: auto; + margin-right: auto; + padding-bottom: 1em; +} + #home .header-content { position: relative; width: 100%; |