From ecc418c93c8910781ee5e8abdc403590071f10b5 Mon Sep 17 00:00:00 2001 From: Reorx Date: Fri, 8 Dec 2023 20:45:17 +0800 Subject: [PATCH] fix section title not disappear when it has no items --- src/themes/reorx/index.ejs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/themes/reorx/index.ejs b/src/themes/reorx/index.ejs index f151a63..60915a9 100644 --- a/src/themes/reorx/index.ejs +++ b/src/themes/reorx/index.ejs @@ -11,6 +11,12 @@ function formatLocation(loc) { return `${loc.address}. ${cityToCountry}` } %> +<% +function hasItems(arr) { + if (arr && arr.length) return true + return false +} +%>
@@ -81,7 +87,7 @@ function dateRange(item, level) { %> -<% if (cv.education) { %> +<% if (hasItems(cv.education)) { %>

Educations

@@ -111,7 +117,7 @@ function dateRange(item, level) { <% } %> -<% if (cv.work) { %> +<% if (hasItems(cv.work)) { %>

Work

@@ -143,7 +149,7 @@ function dateRange(item, level) { <% } %> -<% if (cv.projects) { %> +<% if (hasItems(cv.projects)) { %>

Projects

@@ -186,7 +192,7 @@ function dateRange(item, level) { <% } %> -<% if (cv.sideProjects) { %> +<% if (hasItems(cv.sideProjects)) { %>

Side-projects

@@ -219,7 +225,7 @@ function dateRange(item, level) { <% } %> -<% if (cv.skills) { %> +<% if (hasItems(cv.skills)) { %>

Skills

@@ -247,7 +253,7 @@ function dateRange(item, level) { <% } %> -<% if (cv.languages) { %> +<% if (hasItems(cv.languages)) { %>

Languages