From 2d093103528197a039a70c8e0d05928d4db0ca49 Mon Sep 17 00:00:00 2001 From: Szymon Kin <68154191+hoolek77@users.noreply.github.com> Date: Thu, 26 Jan 2023 21:03:13 +0100 Subject: [PATCH] Support visible property in pdf pages (#180) --- src/pages/pdf.astro | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/pdf.astro b/src/pages/pdf.astro index 2e30076..5fdfc3e 100644 --- a/src/pages/pdf.astro +++ b/src/pages/pdf.astro @@ -13,6 +13,8 @@ const { config, sections } = cv( renameSkillSet('I speak', 'Languages'), hideProject('Disco Ninjas') ); + +const shouldRenderSection = (section: keyof typeof sections) => sections[section] && sections[section].config.visible; --- @@ -23,11 +25,11 @@ const { config, sections } = cv( PDF preview - - {sections.skills && } - {sections.experience && } - {sections.portfolio && } - {sections.education && } + {shouldRenderSection('main') && } + {shouldRenderSection('skills') && } + {shouldRenderSection('experience') && } + {shouldRenderSection('portfolio') && } + {shouldRenderSection('education') && } {config.pdf?.footer && }