modified navigation and banner

This commit is contained in:
Themefisher Dev 2020-02-08 10:40:37 +06:00
parent a85b7a7185
commit 6695462d13
4 changed files with 99 additions and 92 deletions

View file

@ -201,11 +201,23 @@ select:focus {
padding-bottom: 100px;
}
@media (max-width: 768px) {
.section{
padding-top: 60px;
}
}
.section-sm {
padding-top: 80px;
padding-bottom: 80px;
}
@media (max-width: 768px) {
.section-sm{
padding-top: 40px;
}
}
.section-title {
margin-bottom: 40px;
}
@ -326,10 +338,6 @@ header.sticky-top {
top: 100px;
}
.hero-section {
padding-bottom: 150px;
}
.navbar {
padding: 0;
}

View file

@ -1,31 +1,26 @@
<!DOCTYPE html>
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
{{ partial "head.html" . }}
<body>
{{ if .IsHome }}
{{ "<!-- header -->" | safeHTML }}
<header class="hero-section overlay bg-cover banner" data-background="{{ .Site.Params.banner.bg_image | absURL }}">
<div class="container mb-100">
{{ "<!-- navigation -->" | safeHTML }}
<body>
{{ if .IsHome }}
{{ "<!-- header -->" | safeHTML }}
<header class="banner overlay bg-cover" data-background="{{ .Site.Params.banner.bg_image | absURL }}">
{{ partial "navigation.html" . }}
{{ "<!-- /navigation -->" | safeHTML }}
</div>
{{ partial "banner.html" . }}
</header>
{{ "<!-- /header -->" | safeHTML }}
{{ else }}
{{ "<!-- navigation -->" | safeHTML }}
<header class="shadow-bottom sticky-top bg-white">
<div class="container">
{{ partial "banner.html" . }}
</header>
{{ "<!-- /header -->" | safeHTML }}
{{ else }}
{{ "<!-- header -->" | safeHTML }}
<header class="shadow-bottom sticky-top bg-white">
{{ partial "navigation.html" . }}
</header>
{{ "<!-- /header -->" | safeHTML }}
{{ end }}
<div id="content">
{{ block "main" . }}{{ end }}
</div>
</header>
{{ "<!-- /navigation -->" | safeHTML }}
{{ end }}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
{{ partial "footer.html" . }}
</body>
</html>

View file

@ -1,9 +1,9 @@
{{ "<!-- banner -->" | safeHTML }}
<div class="container">
<div class="container section">
<div class="row">
<div class="col-lg-8 text-center mx-auto">
<h1 class="text-white mb-3">{{ .Site.Params.banner.title }}</h1>
<p class="text-white mb-4">{{ .Site.Params.banner.description }}</p>
<h1 class="text-white mb-3">{{ .Site.Params.banner.title | markdownify }}</h1>
<p class="text-white mb-4">{{ .Site.Params.banner.description | markdownify }}</p>
<div class="position-relative">
<input id="search" class="form-control" placeholder="{{ .Site.Params.banner.placeholder }}">

View file

@ -1,67 +1,71 @@
<nav class="navbar navbar-expand-md {{ if .IsHome }}navbar-dark{{ else }}navbar-light{{ end }}">
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}">
{{ $logo:= .Site.Params.logo }}
{{ $logoWhite:= .Site.Params.logo_white }}
{{ if (or $logo $logoWhite) }}
{{ if .IsHome }}
<img class="img-fluid" src="{{if $logoWhite }}{{ $logoWhite | absURL }} {{ else }} {{ $logo | absURL }}{{ end }}" alt="{{ .Site.Title }}">
{{ else }}
<img class="img-fluid" src="{{ $logo | absURL }}" alt="{{ .Site.Title }}">
{{ end }}
{{ else }}
{{ .Site.Title }}
{{ end }}
</a>
<button class="navbar-toggler border-0" type="button" data-toggle="collapse" data-target="#navigation"
aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="container">
<a class="navbar-brand px-2" href="{{ .Site.BaseURL | relLangURL }}">
{{ $logo:= .Site.Params.logo }}
{{ $logoWhite:= .Site.Params.logo_white }}
{{ if (or $logo $logoWhite) }}
{{ if .IsHome }}
<img class="img-fluid" src="{{if $logoWhite }}{{ $logoWhite | absURL }} {{ else }} {{ $logo | absURL }}{{ end }}"
alt="{{ .Site.Title }}">
{{ else }}
<img class="img-fluid" src="{{ $logo | absURL }}" alt="{{ .Site.Title }}">
{{ end }}
{{ else }}
{{ .Site.Title }}
{{ end }}
</a>
<button class="navbar-toggler border-0" type="button" data-toggle="collapse" data-target="#navigation"
aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-center" id="navigation">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link text-dark" href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Params.home }}</a>
</li>
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark" href="#" role="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
{{ .Name }}
</a>
<div class="dropdown-menu">
{{ range .Children }}
<a class="dropdown-item" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link text-dark" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
<div class="collapse navbar-collapse text-center" id="navigation">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link text-dark" href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Params.home }}</a>
</li>
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-dark" href="#" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
{{ .Name }}
</a>
<div class="dropdown-menu">
{{ range .Children }}
<a class="dropdown-item" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link text-dark" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
<!-- Language List -->
{{- if .Site.IsMultiLingual }}
<select class="lang-list {{ if not .IsHome }}dark{{ end }}" id="select-language"
onchange="location = this.value;">
{{ $siteLanguages := .Site.Languages}}
{{ $pageLang := .Page.Lang}}
{{ range .Page.AllTranslations }}
{{ $translation := .}}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
{{ $selected := false }}
{{ if eq $pageLang .Lang}}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
</option>
{{ else }}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</select>
{{ end }}
{{ end }}
</ul>
<!-- Language List -->
{{- if .Site.IsMultiLingual }}
<select class="lang-list {{ if not .IsHome }}dark{{ end }}" id="select-language" onchange="location = this.value;">
{{ $siteLanguages := .Site.Languages}}
{{ $pageLang := .Page.Lang}}
{{ range .Page.AllTranslations }}
{{ $translation := .}}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
{{ $selected := false }}
{{ if eq $pageLang .Lang}}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
</option>
{{ else }}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</select>
{{ end }}
</div>
</div>
</nav>