From 88a081402518c72344245a0fcb81dfa93d662e21 Mon Sep 17 00:00:00 2001 From: vlebert <49779177+vlebert@users.noreply.github.com> Date: Fri, 4 Jun 2021 06:30:22 +0200 Subject: [PATCH 1/3] Fix some french translations (#343) * resize skillcards by CSS instead of JS * Revert "resize skillcards by CSS instead of JS" This reverts commit 169e0599e9ff771c1cf58c03fb799c42aac65092. * french translation Co-authored-by: vlebert --- i18n/fr.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/fr.toml b/i18n/fr.toml index 97c17cb..8565dd5 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -3,7 +3,7 @@ other = "Accueil" [posts] -other = "Des postes" +other = "Articles" [toc_heading] other = "Table des matières" @@ -89,8 +89,8 @@ other = "Montrer moins" # [comments_by] # other = "comments powered by" -# [read] -# other = "Read" +[read] +other = "Lire" # [project_star] # other = "Star" From 08a09d5c7145b3b22902fe2ae742a53070ad24be Mon Sep 17 00:00:00 2001 From: Kaligule Date: Sat, 5 Jun 2021 19:58:26 +0200 Subject: [PATCH 2/3] Disable logo by default + add logo only if the user provide it * Disable logo by default, allow to enable with params.logo.enable * Don't default logo into theme logo Signed-off-by: hossainemruz * add missing comma Signed-off-by: hossainemruz * Remove unnecessary changes Signed-off-by: hossainemruz Co-authored-by: Johannes Lippmann Co-authored-by: hossainemruz --- layouts/partials/header.html | 31 ++++++++--------- layouts/partials/navigators/navbar-2.html | 41 ++++++++++++++--------- layouts/partials/navigators/navbar.html | 40 +++++++++++++--------- static/js/navbar.js | 15 ++++++--- 4 files changed, 75 insertions(+), 52 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2d126b6..7568437 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,18 +1,3 @@ -{{/* default favicon */}} -{{ $favicon := "/images/favicon.png" }} - -{{/* if favicon is provided in the config, then use that */}} -{{ if site.Params.logo.favicon }} - {{ $favicon = site.Params.logo.favicon }} -{{ end }} - -{{/* resize the favicon. don't resize svg because it is not supported */}} -{{ $favicon := resources.Get $favicon }} -{{ if and $favicon (ne $favicon.MediaType.SubType "svg") }} - {{ $favicon = $favicon.Resize "42x" }} -{{ end }} -{{ $favicon = $favicon.RelPermalink}} - @@ -28,5 +13,17 @@ - - + +{{/* add favicon only if the site author has provided the the favicon */}} +{{ if site.Params.logo.favicon }} + {{ $favicon := site.Params.logo.favicon }} + + {{/* resize the favicon. don't resize svg because it is not supported */}} + {{ $favicon = resources.Get $favicon }} + {{ if and $favicon (ne $favicon.MediaType.SubType "svg") }} + {{ $favicon = $favicon.Resize "42x" }} + {{ end }} + {{ $favicon = $favicon.RelPermalink}} + + +{{end}} diff --git a/layouts/partials/navigators/navbar-2.html b/layouts/partials/navigators/navbar-2.html index 86b4626..c129f6e 100644 --- a/layouts/partials/navigators/navbar-2.html +++ b/layouts/partials/navigators/navbar-2.html @@ -1,28 +1,31 @@ -{{/* default logos */}} -{{ $mainLogo := "/images/main-logo.png" }} -{{ $invertedLogo := "/images/inverted-logo.png" }} +{{/* by default, don't use any logo */}} +{{ $mainLogo := "" }} +{{ $invertedLogo := "" }} -{{/* if custom logo has been provided in the config file, then use them */}} +{{/* if custom logo has been provided, use them */}} {{ if site.Params.logo.main }} {{ $mainLogo = site.Params.logo.main }} {{ end }} - {{ if site.Params.logo.inverted }} {{ $invertedLogo = site.Params.logo.inverted }} {{ end }} {{/* resize the logos. don't resize svg because it is not supported */}} -{{ $mainLogo := resources.Get $mainLogo}} -{{ if and $mainLogo (ne $mainLogo.MediaType.SubType "svg") }} - {{ $mainLogo = $mainLogo.Resize "42x" }} +{{ if $mainLogo }} + {{ $mainLogo = resources.Get $mainLogo}} + {{ if and $mainLogo (ne $mainLogo.MediaType.SubType "svg") }} + {{ $mainLogo = $mainLogo.Resize "42x" }} + {{ end }} + {{ $mainLogo = $mainLogo.RelPermalink}} {{ end }} -{{ $mainLogo = $mainLogo.RelPermalink}} -{{ $invertedLogo := resources.Get $invertedLogo}} -{{ if and $invertedLogo (ne $invertedLogo.MediaType.SubType "svg") }} - {{ $invertedLogo = $invertedLogo.Resize "42x" }} +{{ if $invertedLogo }} + {{ $invertedLogo = resources.Get $invertedLogo}} + {{ if and $invertedLogo (ne $invertedLogo.MediaType.SubType "svg")}} + {{ $invertedLogo = $invertedLogo.Resize "42x" }} + {{ end }} + {{ $invertedLogo = $invertedLogo.RelPermalink}} {{ end }} -{{ $invertedLogo = $invertedLogo.RelPermalink}} diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index df29cdc..ed6cff9 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -7,11 +7,11 @@ {{ $blogEnabled = true }} {{ end }} -{{/* default logos */}} -{{ $mainLogo := "/images/main-logo.png" }} -{{ $invertedLogo := "/images/inverted-logo.png" }} +{{/* by default, don't use any logo */}} +{{ $mainLogo := "" }} +{{ $invertedLogo := "" }} -{{/* if custom logo is used, them */}} +{{/* if custom logo has been provided, use them */}} {{ if site.Params.logo.main }} {{ $mainLogo = site.Params.logo.main }} {{ end }} @@ -20,17 +20,21 @@ {{ end }} {{/* resize the logos. don't resize svg because it is not supported */}} -{{ $mainLogo := resources.Get $mainLogo}} -{{ if and $mainLogo (ne $mainLogo.MediaType.SubType "svg") }} - {{ $mainLogo = $mainLogo.Resize "42x" }} +{{ if $mainLogo }} + {{ $mainLogo = resources.Get $mainLogo}} + {{ if and $mainLogo (ne $mainLogo.MediaType.SubType "svg") }} + {{ $mainLogo = $mainLogo.Resize "42x" }} + {{ end }} + {{ $mainLogo = $mainLogo.RelPermalink}} {{ end }} -{{ $mainLogo = $mainLogo.RelPermalink}} -{{ $invertedLogo := resources.Get $invertedLogo}} -{{ if and $invertedLogo (ne $invertedLogo.MediaType.SubType "svg")}} - {{ $invertedLogo = $invertedLogo.Resize "42x" }} +{{ if $invertedLogo }} + {{ $invertedLogo = resources.Get $invertedLogo}} + {{ if and $invertedLogo (ne $invertedLogo.MediaType.SubType "svg")}} + {{ $invertedLogo = $invertedLogo.Resize "42x" }} + {{ end }} + {{ $invertedLogo = $invertedLogo.RelPermalink}} {{ end }} -{{ $invertedLogo = $invertedLogo.RelPermalink}} {{ $customMenus := site.Params.customMenus }} {{ if (index site.Data site.Language.Lang).site.customMenus }} @@ -45,7 +49,9 @@ diff --git a/static/js/navbar.js b/static/js/navbar.js index 929c74b..1d5ca97 100644 --- a/static/js/navbar.js +++ b/static/js/navbar.js @@ -16,8 +16,12 @@ $('#navbar-toggler').addClass('navbar-light'); // get the main logo from hidden img tag - let mainLogo = document.getElementById("main-logo").getAttribute("src"); - $('#logo').attr("src", mainLogo); + let mainLogo = document.getElementById("main-logo") + if (mainLogo !== null) { + let logoURL = mainLogo.getAttribute("src"); + $('#logo').attr("src", logoURL); + } + } else { $('#top-navbar').removeClass('final-navbar shadow'); $('#top-navbar').addClass('initial-navbar'); @@ -26,8 +30,11 @@ $('#navbar-toggler').addClass('navbar-dark'); // get the inverted logo from hidden img tag - let invertedLogo = document.getElementById("inverted-logo").getAttribute("src"); - $('#logo').attr("src", invertedLogo); + let invertedLogo = document.getElementById("inverted-logo") + if (invertedLogo !== null) { + let logoURL = invertedLogo.getAttribute("src"); + $('#logo').attr("src", logoURL); + } } }); From 65a429b664af0eca1f376dc3a9e77dbc39959b18 Mon Sep 17 00:00:00 2001 From: vlebert <49779177+vlebert@users.noreply.github.com> Date: Sat, 5 Jun 2021 20:14:32 +0200 Subject: [PATCH 3/3] Use CSS to fix Skill cards height instead JS (#342) * resize skillcards by CSS instead of JS * Revert "resize skillcards by CSS instead of JS" This reverts commit 169e0599e9ff771c1cf58c03fb799c42aac65092. * resize skillcards by CSS instead of JS Co-authored-by: vlebert Co-authored-by: Emruz Hossain --- static/css/sections/skills.css | 1 + static/js/home.js | 28 +++------------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/static/css/sections/skills.css b/static/css/sections/skills.css index 374d3c6..211da14 100644 --- a/static/css/sections/skills.css +++ b/static/css/sections/skills.css @@ -19,6 +19,7 @@ .skills-section .card { margin-top: 0.5rem; margin-bottom: 0.5rem; + height: 100%; } .skills-section .card .card-body { diff --git a/static/js/home.js b/static/js/home.js index fe93469..91fc725 100644 --- a/static/js/home.js +++ b/static/js/home.js @@ -63,28 +63,6 @@ var projectCards; } } - // ==================== Adjust height of the skills card ============= - function adjustSkillCardsHeight() { - if (!isMobile) { // no need to adjust height for mobile devices - // primary skills - var skillCards = document.getElementById("primary-skills"); - if (skillCards != null) { - var cardElems = skillCards.getElementsByClassName("card"); - var maxHeight = 0; - for (let i = 0; i < cardElems.length; i++) { - if (cardElems.item(i).clientHeight > maxHeight) { - maxHeight = cardElems.item(i).clientHeight; - } - } - for (let i = 0; i < cardElems.length; i++) { - cardElems.item(i).setAttribute("style", "min-height: " + maxHeight + "px;"); - } - } - } - } - $(window).on("load", function () { - adjustSkillCardsHeight(); - }); // ================== Project cards ===================== // Add click action on project category selector buttons @@ -331,17 +309,17 @@ var projectCards; this.parentElement.classList.toggle("col-sm-12"); if (this.children["SmallImage"].hasAttribute("active")) { let mainLogo = this.children["LargeImage"].getAttribute("Style"); - this.children["LargeImage"].setAttribute("active",true); + this.children["LargeImage"].setAttribute("active", true); this.children["SmallImage"].removeAttribute("active"); this.setAttribute("Style", mainLogo); } else { let mainLogo = this.children["SmallImage"].getAttribute("Style"); - this.children["SmallImage"].setAttribute("active",true); + this.children["SmallImage"].setAttribute("active", true); this.children["LargeImage"].removeAttribute("active"); this.setAttribute("Style", mainLogo); } - + if (this.children["caption"] != undefined) { this.children["caption"].classList.toggle("hidden"); }