Skip to content

Commit

Permalink
fix: allow empty address fields, remove postalcode field
Browse files Browse the repository at this point in the history
  • Loading branch information
jskherman committed Jun 14, 2024
1 parent b602e33 commit adca81d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion cv.typ
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@
// Address
#let addresstext(info, uservars) = {
if uservars.showAddress {
// Filter out empty address fields
let address = info.personal.location.pairs().filter(it => it.at(1) != none and str(it.at(1)) != "")
// Join non-empty address fields with commas
let location = address.map(it => str(it.at(1))).join(", ")

block(width: 100%)[
#info.personal.location.city, #info.personal.location.region, #info.personal.location.country #info.personal.location.postalCode
#location
#v(-4pt)
]
} else {none}
Expand Down
1 change: 0 additions & 1 deletion cv.typ.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"required": [
"city",
"region",
"postalCode",
"country"
],
"properties": {
Expand Down
1 change: 0 additions & 1 deletion template/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ personal:
location:
city: New York
region: New York
postalCode: 1234
country: United States of America
profiles:
- network: LinkedIn
Expand Down

0 comments on commit adca81d

Please sign in to comment.