From f85b8a2e8e3faec4c812f81748587e3f183860aa Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Sun, 14 Jun 2020 14:39:39 +0600 Subject: [PATCH] Make log hugoBasicExample error free --- layouts/partials/projects.html | 5 +++-- static/assets/js/home.js | 24 ++++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/layouts/partials/projects.html b/layouts/partials/projects.html index c535518..4de5104 100644 --- a/layouts/partials/projects.html +++ b/layouts/partials/projects.html @@ -10,8 +10,9 @@
-
- {{ range .Site.Data.projects.projects }} {{ partial "cards/project" . }} +
+ {{ range .Site.Data.projects.projects }} + {{ partial "cards/project" . }} {{ end }}
diff --git a/static/assets/js/home.js b/static/assets/js/home.js index 624d22b..f9b278c 100644 --- a/static/assets/js/home.js +++ b/static/assets/js/home.js @@ -29,16 +29,18 @@ var projectCards; if (document.getElementById('typing-carousel-data') != undefined) { var ul = document.getElementById('typing-carousel-data').children; - var data = []; - Array.from(ul).forEach(el => { - data.push(el.textContent); - }) + if (ul.length != 0) { + var data = []; + Array.from(ul).forEach(el => { + data.push(el.textContent); + }) - ityped.init('#ityped', { - strings: data, - startDelay: 200, - loop: true - }); + ityped.init('#ityped', { + strings: data, + startDelay: 200, + loop: true + }); + } } // ================= Smooth Scroll =================== @@ -113,7 +115,9 @@ var projectCards; } } - projectCards = $(".filtr-projects").filterizr({ layout: 'sameWidth' }); + if (document.getElementById("project-card-holder").children.length != 0) { + projectCards = $(".filtr-projects").filterizr({ layout: 'sameWidth' }); + } function showGithubStars() { // fix the github button class