From 8ec90ee2556fc6c523ffc0ef79a2288c274a1330 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 22 Jul 2020 03:36:53 +0600 Subject: [PATCH] Refactor sidebar logic + fix responsiveness --- layouts/404.html | 2 +- layouts/_default/baseof.html | 8 +- layouts/_default/list.html | 55 +- layouts/_default/single.html | 117 ++-- layouts/index.html | 21 +- layouts/partials/cards/post.html | 2 +- layouts/partials/cards/project.html | 2 +- layouts/partials/cards/recent-post.html | 2 +- layouts/partials/cards/skill.html | 2 +- .../partials/experiences/experience-info.html | 5 - layouts/partials/header.html | 3 +- layouts/partials/helpers/get-categories.html | 5 - .../{progress => misc}/soft-skills.html | 0 layouts/partials/navbar-2.html | 16 - layouts/partials/navigators/navbar-2.html | 19 + layouts/partials/{ => navigators}/navbar.html | 8 +- .../{ => navigators}/next-prev-navigator.html | 0 layouts/partials/navigators/sidebar.html | 22 + layouts/partials/scripts.html | 2 +- layouts/partials/sections.html | 11 - layouts/partials/{ => sections}/about.html | 8 +- .../partials/{ => sections}/achievements.html | 2 +- .../achievements/entry.html} | 0 .../partials/{ => sections}/experiences.html | 10 +- .../sections/experiences/experience-info.html | 5 + .../experiences/horizontal-line.html | 0 .../experiences/multiple-positions.html | 0 .../experiences/single-position.html | 0 .../experiences/vertical-line.html | 0 layouts/partials/{ => sections}/home.html | 0 layouts/partials/{ => sections}/projects.html | 0 .../partials/{ => sections}/recent-posts.html | 0 layouts/partials/{ => sections}/skills.html | 0 static/assets/css/404.css | 22 +- static/assets/css/list.css | 532 ++++++++---------- static/assets/css/main.css | 47 +- static/assets/css/{ => navigators}/navbar.css | 105 +++- static/assets/css/navigators/sidebar.css | 315 +++++++++++ static/assets/css/projects.css | 61 -- static/assets/css/recent-posts.css | 28 - static/assets/css/{ => sections}/about.css | 25 +- .../css/{ => sections}/achievements.css | 29 +- .../assets/css/{ => sections}/experiences.css | 24 +- static/assets/css/{ => sections}/home.css | 22 +- static/assets/css/sections/projects.css | 113 ++++ static/assets/css/sections/recent-posts.css | 82 +++ static/assets/css/{ => sections}/skills.css | 29 +- static/assets/css/single.css | 331 ++++++++++- static/assets/css/style.css | 48 +- static/assets/js/home.js | 30 +- static/assets/js/list.js | 68 +-- static/assets/js/main.js | 122 ++++ static/assets/js/single.js | 23 + 53 files changed, 1712 insertions(+), 671 deletions(-) delete mode 100644 layouts/partials/experiences/experience-info.html delete mode 100644 layouts/partials/helpers/get-categories.html rename layouts/partials/{progress => misc}/soft-skills.html (100%) delete mode 100644 layouts/partials/navbar-2.html create mode 100644 layouts/partials/navigators/navbar-2.html rename layouts/partials/{ => navigators}/navbar.html (85%) rename layouts/partials/{ => navigators}/next-prev-navigator.html (100%) create mode 100644 layouts/partials/navigators/sidebar.html delete mode 100644 layouts/partials/sections.html rename layouts/partials/{ => sections}/about.html (86%) rename layouts/partials/{ => sections}/achievements.html (88%) rename layouts/partials/{misc/achievement.html => sections/achievements/entry.html} (100%) rename layouts/partials/{ => sections}/experiences.html (63%) create mode 100644 layouts/partials/sections/experiences/experience-info.html rename layouts/partials/{ => sections}/experiences/horizontal-line.html (100%) rename layouts/partials/{ => sections}/experiences/multiple-positions.html (100%) rename layouts/partials/{ => sections}/experiences/single-position.html (100%) rename layouts/partials/{ => sections}/experiences/vertical-line.html (100%) rename layouts/partials/{ => sections}/home.html (100%) rename layouts/partials/{ => sections}/projects.html (100%) rename layouts/partials/{ => sections}/recent-posts.html (100%) rename layouts/partials/{ => sections}/skills.html (100%) rename static/assets/css/{ => navigators}/navbar.css (62%) create mode 100644 static/assets/css/navigators/sidebar.css delete mode 100644 static/assets/css/projects.css delete mode 100644 static/assets/css/recent-posts.css rename static/assets/css/{ => sections}/about.css (94%) rename static/assets/css/{ => sections}/achievements.css (85%) rename static/assets/css/{ => sections}/experiences.css (90%) rename static/assets/css/{ => sections}/home.css (82%) create mode 100644 static/assets/css/sections/projects.css create mode 100644 static/assets/css/sections/recent-posts.css rename static/assets/css/{ => sections}/skills.css (64%) create mode 100644 static/assets/js/main.js diff --git a/layouts/404.html b/layouts/404.html index 45b51d2..5c2c730 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -3,7 +3,7 @@ {{ end }} {{ define "navbar" }} - {{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false) }} + {{ partial "navigators/navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false) }} {{ end }} {{ define "content" }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 1ed13f1..e47c959 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,13 +14,19 @@ {{ end }} - +
{{ block "navbar" . }} {{ end }} + + {{ block "sidebar" . }} {{ end }} + {{ block "content" . }} {{ end }} + + + {{ block "toc" . }} {{ end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 5f463ab..b7a05e5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,39 +1,44 @@ {{ define "header" }} + {{ end }} {{ define "navbar" }} - {{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" true "navBrandURL" .Site.BaseURL ) }} + {{ partial "navigators/navbar-2.html" . }} +{{ end }} + +{{ define "sidebar" }} + {{ end }} {{ define "content" }} - +
-
-
- {{ range (where site.RegularPages "Type" "in" site.Params.mainSections) }} - {{ partial "cards/post.html" . }} - {{ end }} - {{/* {{ $paginator := .Paginate .Site.RegularPages 120 }} - {{ range $paginator.Pages }} - {{ partial "cards/post.html" . }} - {{ end }} */}} -
- {{/*
- {{ template "_internal/pagination.html" . }} -
*/}} +
+ {{ $paginator := .Paginate .RegularPagesRecursive 12 }} + {{ range $paginator.Pages }} + {{ partial "cards/post.html" . }} + {{ end }} +
+
+ {{ template "_internal/pagination.html" . }}
+
{{ end }} {{ define "scripts" }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8c2de23..bf1304b 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,55 +4,92 @@ href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css" /> + {{ end }} {{ define "navbar" }} - {{ partial "navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false "navBrandURL" "/posts") }} + {{ partial "navigators/navbar-2.html" . }} +{{ end }} + +{{ define "sidebar" }} + {{ end }} {{ define "content" }} -
- -
-
- - -
-
- -
{{ partial "helpers/get-author-name.html" . }}
-

{{ .Page.Date.Format "January 2, 2006" }}

-
- -
-

{{ .Page.Title }}

-
- -
- {{ .Page.Content }} -
- - - {{ if .Site.Params.GitRepo }} -
- - - Improve This Page - +
+
+
+ +
- {{ end }} - - -
- {{ partial "next-prev-navigator.html" . }} -
- - {{ if .Site.DisqusShortname }} - {{ partial "disqus.html" . }} - {{ end }} -
+ + +
+
+ +
{{ partial "helpers/get-author-name.html" . }}
+

{{ .Page.Date.Format "January 2, 2006" }}

+
+ +
+

{{ .Page.Title }}

+
+ +
+ {{ .Page.Content }} +
+ + + {{ if .Site.Params.GitRepo }} + + {{ end }} + + +
+ {{ partial "navigators/next-prev-navigator.html" . }} +
+ + {{ if .Site.DisqusShortname }} + {{ partial "disqus.html" . }} + {{ end }} +
+
+
+ {{ end }} +{{ define "toc" }} +
+ {{ if site.Params.enableTOC }} +
+
Table of Contents
+
+
+ {{ .TableOfContents }} +
+
+ {{ end }} +
+{{ end }} {{ define "scripts" }} diff --git a/layouts/index.html b/layouts/index.html index a7f621c..dc93e8c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -6,13 +6,13 @@ {{- partial "header.html" . -}} - - - - - - - + + + + + + + {{ if .Site.GoogleAnalytics }} @@ -22,10 +22,10 @@ - {{- partial "navbar.html" . -}} + {{- partial "navigators/navbar.html" . -}} - {{- partial "home.html" . -}} + {{- partial "sections/home.html" . -}} {{ if .Site.Data.sections }} @@ -36,7 +36,7 @@ {{ if .section.template }} {{- partial .section.template . -}} {{ else }} - {{- partial (printf "%s.html" (replace (lower .section.name) " " "-")) . -}} + {{- partial (printf "sections/%s.html" (replace (lower .section.name) " " "-")) . -}} {{ end }}
@@ -59,5 +59,6 @@ + diff --git a/layouts/partials/cards/post.html b/layouts/partials/cards/post.html index 6787e28..663510b 100644 --- a/layouts/partials/cards/post.html +++ b/layouts/partials/cards/post.html @@ -1,4 +1,4 @@ -
+
diff --git a/layouts/partials/cards/project.html b/layouts/partials/cards/project.html index dfd8918..17bf3b0 100644 --- a/layouts/partials/cards/project.html +++ b/layouts/partials/cards/project.html @@ -1,5 +1,5 @@
diff --git a/layouts/partials/cards/recent-post.html b/layouts/partials/cards/recent-post.html index 7295f86..5288b9f 100644 --- a/layouts/partials/cards/recent-post.html +++ b/layouts/partials/cards/recent-post.html @@ -1,4 +1,4 @@ -
+
diff --git a/layouts/partials/cards/skill.html b/layouts/partials/cards/skill.html index d8e1732..0da4050 100644 --- a/layouts/partials/cards/skill.html +++ b/layouts/partials/cards/skill.html @@ -1,4 +1,4 @@ -
+
{{ if .icon }} diff --git a/layouts/partials/experiences/experience-info.html b/layouts/partials/experiences/experience-info.html deleted file mode 100644 index c4e1a92..0000000 --- a/layouts/partials/experiences/experience-info.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ if gt (len .positions) 1 }} - {{ partial "experiences/multiple-positions" . }} -{{ else }} - {{ partial "experiences/single-position.html" . }} -{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index b898b98..9ffdb2f 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -5,7 +5,8 @@ - + + diff --git a/layouts/partials/helpers/get-categories.html b/layouts/partials/helpers/get-categories.html deleted file mode 100644 index f9d39b6..0000000 --- a/layouts/partials/helpers/get-categories.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ $categories:= ""}} -{{ if .Params.categories }} - {{ $categories = delimit .Params.categories "," }} -{{ end }} -{{ return $categories }} diff --git a/layouts/partials/progress/soft-skills.html b/layouts/partials/misc/soft-skills.html similarity index 100% rename from layouts/partials/progress/soft-skills.html rename to layouts/partials/misc/soft-skills.html diff --git a/layouts/partials/navbar-2.html b/layouts/partials/navbar-2.html deleted file mode 100644 index 03fb869..0000000 --- a/layouts/partials/navbar-2.html +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/layouts/partials/navigators/navbar-2.html b/layouts/partials/navigators/navbar-2.html new file mode 100644 index 0000000..bca52a9 --- /dev/null +++ b/layouts/partials/navigators/navbar-2.html @@ -0,0 +1,19 @@ + diff --git a/layouts/partials/navbar.html b/layouts/partials/navigators/navbar.html similarity index 85% rename from layouts/partials/navbar.html rename to layouts/partials/navigators/navbar.html index fba1b31..0873fa4 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -1,4 +1,4 @@ -