Skip to content

Commit

Permalink
fix section title not disappear when it has no items
Browse files Browse the repository at this point in the history
  • Loading branch information
reorx committed Dec 8, 2023
1 parent 1f03fa8 commit ecc418c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/themes/reorx/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ function formatLocation(loc) {
return `${loc.address}. ${cityToCountry}`
}
%>
<%
function hasItems(arr) {
if (arr && arr.length) return true
return false
}
%>

<!-- Basics -->
<section class="basics-section">
Expand Down Expand Up @@ -81,7 +87,7 @@ function dateRange(item, level) {
%>

<!-- Educations -->
<% if (cv.education) { %>
<% if (hasItems(cv.education)) { %>
<section class="education-section">
<div class="section-title">
<h2>Educations</h2>
Expand Down Expand Up @@ -111,7 +117,7 @@ function dateRange(item, level) {
<% } %>

<!-- Work -->
<% if (cv.work) { %>
<% if (hasItems(cv.work)) { %>
<section class="work-section">
<div class="section-title">
<h2>Work</h2>
Expand Down Expand Up @@ -143,7 +149,7 @@ function dateRange(item, level) {
<% } %>

<!-- Projects -->
<% if (cv.projects) { %>
<% if (hasItems(cv.projects)) { %>
<section class="projects-section">
<div class="section-title">
<h2>Projects</h2>
Expand Down Expand Up @@ -186,7 +192,7 @@ function dateRange(item, level) {
<% } %>

<!-- Side-projects -->
<% if (cv.sideProjects) { %>
<% if (hasItems(cv.sideProjects)) { %>
<section class="sideprojects-section">
<div class="section-title">
<h2>Side-projects</h2>
Expand Down Expand Up @@ -219,7 +225,7 @@ function dateRange(item, level) {
<% } %>

<!-- Skills -->
<% if (cv.skills) { %>
<% if (hasItems(cv.skills)) { %>
<section class="skills-section">
<div class="section-title">
<h2>Skills</h2>
Expand Down Expand Up @@ -247,7 +253,7 @@ function dateRange(item, level) {
<% } %>

<!-- Languages -->
<% if (cv.languages) { %>
<% if (hasItems(cv.languages)) { %>
<section class="languages-section page-unit">
<div class="section-title">
<h2>Languages</h2>
Expand Down

0 comments on commit ecc418c

Please sign in to comment.