jskherman / imprecv

A no-frills curriculum vitae (CV) template using Typst and YAML to version control CV data.
Apache License 2.0
319 stars 38 forks source link

'uservars.showNumber=false' leaves empty element in 'profiles' #7

Closed nrmancuso closed 9 months ago

nrmancuso commented 9 months ago

Greetings cv.typ maintainers, it seems like the filtering of nones in profiles is not working correctly.

➜  cv-typist git:(update-cv) ✗ git diff -u
diff --git a/my-cv-content.typ b/my-cv-content.typ
index 787c258..eeae905 100644
--- a/my-cv-content.typ
+++ b/my-cv-content.typ
@@ -9,7 +9,7 @@
     fontsize: 10pt, // 10pt, 11pt, 12pt
     linespacing: 6pt,
     showAddress: true, // true/false Show address in contact info
-    showNumber: true,  // true/false Show phone number in contact info
+    showNumber: false,  // true/false Show phone number in contact info
 )

 // setrules and showrules can be overridden by re-declaring it here
➜  cv-typist git:(update-cv) ✗ typst compile my-cv-content.typ

➜  cv-typist git:(update-cv) ✗ echo $?
0

Results: image

➜  cv-typist git:(update-cv) ✗ cd cv.typ 
➜  cv.typ git:(formatting) ✗ git diff -u
diff --git a/cv.typ b/cv.typ
index 1f950a9..ca67113 100644
--- a/cv.typ
+++ b/cv.typ
@@ -85,7 +85,7 @@
     // Create a list of contact profiles
     #let profiles = (
         box(link("mailto:" + info.personal.email)),
-        if uservars.showNumber {box(link("tel:" + info.personal.phone))} else {none},
+        //if uservars.showNumber {box(link("tel:" + info.personal.phone))} else {none},
         if info.personal.url != none {
             box(link(info.personal.url)[#info.personal.url.split("//").at(1)])
         }
➜  cv.typ git:(formatting) ✗ cd ..
➜  cv-typist git:(update-cv) ✗ typst compile my-cv-content.typ

➜  cv-typist git:(update-cv) ✗ echo $?                        
0

Results: image