diff options
author | Emruz Hossain <hossainemruz@gmail.com> | 2020-10-11 09:40:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-11 09:40:00 +0300 |
commit | 56c8ba4e4389b0593996737cd8a567ff01646503 (patch) | |
tree | dbd451125da953f1d8f8e24ef68e7daf2c4c6b8c /layouts | |
parent | c7f2ad72ea64e6bb11e4d44dec14cfa73ec04e45 (diff) |
Fix smooth scroll for multi-language setup (#93)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/footer.html | 10 | ||||
-rw-r--r-- | layouts/partials/navigators/navbar.html | 6 | ||||
-rw-r--r-- | layouts/partials/sections/about.html | 7 | ||||
-rw-r--r-- | layouts/partials/sections/achievements.html | 7 | ||||
-rw-r--r-- | layouts/partials/sections/experiences.html | 7 | ||||
-rw-r--r-- | layouts/partials/sections/home.html | 6 | ||||
-rw-r--r-- | layouts/partials/sections/projects.html | 7 | ||||
-rw-r--r-- | layouts/partials/sections/recent-posts.html | 7 | ||||
-rw-r--r-- | layouts/partials/sections/skills.html | 7 |
9 files changed, 53 insertions, 11 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 90cff75..d39f682 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -25,9 +25,13 @@ <ul> {{- range sort $sections "section.weight" }} {{ if and (.section.enable) (.section.showOnNavbar)}} - <li class="nav-item"> - <a class="smooth-scroll" href="/#{{ replace (lower .section.name) " " "-" }}">{{ .section.name }}</a> - </li> + {{ $sectionID := replace (lower .section.name) " " "-" }} + {{ if .section.id }} + {{ $sectionID = .section.id }} + {{ end }} + <li class="nav-item"> + <a class="smooth-scroll" href="/#{{ $sectionID }}">{{ .section.name }}</a> + </li> {{ end }} {{- end }} </ul> diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index f0575df..e947bf8 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -36,8 +36,12 @@ {{ if $sections }} {{ range sort $sections "section.weight" }} {{ if and (.section.enable) (.section.showOnNavbar)}} + {{ $sectionID := replace (lower .section.name) " " "-" }} + {{ if .section.id }} + {{ $sectionID = .section.id }} + {{ end }} <li class="nav-item"> - <a class="nav-link" href="#{{ replace (lower .section.name) " " "-" }}">{{ .section.name }}</a> + <a class="nav-link" href="#{{ $sectionID }}">{{ .section.name }}</a> </li> {{ end }} {{- end }} diff --git a/layouts/partials/sections/about.html b/layouts/partials/sections/about.html index dcdf784..ea00d6b 100644 --- a/layouts/partials/sections/about.html +++ b/layouts/partials/sections/about.html @@ -1,4 +1,9 @@ -<div class="container anchor p-lg-5 about-section" id="{{ replace (lower .section.name) " " "-" }}"> +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} + +<div class="container anchor p-lg-5 about-section" id="{{ $sectionID }}"> <div class="row pt-sm-2 pt-md-4 align-self-center"> <!-- summary --> <div class="col-sm-6"> diff --git a/layouts/partials/sections/achievements.html b/layouts/partials/sections/achievements.html index bd9a192..9744fc7 100644 --- a/layouts/partials/sections/achievements.html +++ b/layouts/partials/sections/achievements.html @@ -1,4 +1,9 @@ -<div class="container-fluid anchor pb-5 achievements-section" id="{{ replace (lower .section.name) " " "-" }}"> +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} + +<div class="container-fluid anchor pb-5 achievements-section" id="{{ $sectionID }}"> {{ if not (.section.hideTitle) }} <h1 class="text-center">{{ .section.name }}</h1> {{ end }} diff --git a/layouts/partials/sections/experiences.html b/layouts/partials/sections/experiences.html index 8d6b72f..c0c6ff8 100644 --- a/layouts/partials/sections/experiences.html +++ b/layouts/partials/sections/experiences.html @@ -1,4 +1,9 @@ -<div class="container-fluid anchor pb-5 experiences-section" id="{{ replace (lower .section.name) " " "-" }}"> +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} + +<div class="container-fluid anchor pb-5 experiences-section" id="{{ $sectionID }}"> {{ if not (.section.hideTitle) }} <h1 class="text-center">{{ .section.name }}</h1> {{ end }} diff --git a/layouts/partials/sections/home.html b/layouts/partials/sections/home.html index 4766a31..76715f7 100644 --- a/layouts/partials/sections/home.html +++ b/layouts/partials/sections/home.html @@ -48,7 +48,11 @@ </ul> {{ if $sections }} {{ range first 1 (where (sort $sections "section.weight") ".section.enable" true) }} - <a href="#{{ replace (lower .section.name) " " "-" }}"><i class="arrow bounce fa fa-chevron-down"></i></a> + {{ $sectionID := replace (lower .section.name) " " "-" }} + {{ if .section.id }} + {{ $sectionID = .section.id }} + {{ end }} + <a href="#{{ $sectionID }}"><i class="arrow bounce fa fa-chevron-down"></i></a> {{ end }} {{ end }} </div> diff --git a/layouts/partials/sections/projects.html b/layouts/partials/sections/projects.html index fc23c72..dd3ec39 100644 --- a/layouts/partials/sections/projects.html +++ b/layouts/partials/sections/projects.html @@ -1,4 +1,9 @@ -<div class="container-fluid anchor pb-5 projects-section" id="{{ replace (lower .section.name) " " "-" }}"> +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} + +<div class="container-fluid anchor pb-5 projects-section" id="{{ $sectionID }}"> {{ if not (.section.hideTitle) }} <h1 class="text-center">{{ .section.name }}</h1> {{ end }} diff --git a/layouts/partials/sections/recent-posts.html b/layouts/partials/sections/recent-posts.html index 2d0cc87..46387d2 100644 --- a/layouts/partials/sections/recent-posts.html +++ b/layouts/partials/sections/recent-posts.html @@ -1,4 +1,9 @@ -<div class="container-fluid anchor pb-5 recent-posts-section" id="{{ replace (lower .section.name) " " "-" }}"> +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} + +<div class="container-fluid anchor pb-5 recent-posts-section" id="{{ $sectionID }}"> {{ if not (.section.hideTitle) }} <h1 class="text-center">{{ .section.name }}</h1> {{ end }} diff --git a/layouts/partials/sections/skills.html b/layouts/partials/sections/skills.html index 8790be6..0bfb92b 100644 --- a/layouts/partials/sections/skills.html +++ b/layouts/partials/sections/skills.html @@ -1,4 +1,9 @@ -<div class="container-fluid anchor pb-5 skills-section" id="{{ replace (lower .section.name) " " "-" }}"> +{{ $sectionID := replace (lower .section.name) " " "-" }} +{{ if .section.id }} + {{ $sectionID = .section.id }} +{{ end }} + +<div class="container-fluid anchor pb-5 skills-section" id="{{ $sectionID }}"> {{ if not (.section.hideTitle) }} <h1 class="text-center">{{ .section.name }}</h1> {{ end }} |