Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds header_info_size variable to metadata #77

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cv.typ
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
let lastName = metadata.personal.last_name
let headerQuote = metadata.lang.at(metadata.language).header_quote
let displayProfilePhoto = metadata.layout.header.display_profile_photo
let headerInfoFontSize = metadata.layout.header.info_font_size
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For optional value, please use syntax like metadata.layout.at("before_section_skip", default: 1pt) with default value.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you will also need to add eval function, as font size is not string in typst but a special data type.

// let profilePhoto = metadata.layout.header.profile_photo_path
let accentColor = setAccentColor(awesomeColors, metadata)
let nonLatinName = ""
Expand Down Expand Up @@ -61,7 +62,7 @@
text(font: headerFont, size: 32pt, weight: "bold", str)
}
let headerInfoStyle(str) = {
text(size: 10pt, fill: accentColor, str)
text(size: headerInfoFontSize, fill: accentColor, str)
}
let headerQuoteStyle(str) = {
text(size: 10pt, weight: "medium", style: "italic", fill: accentColor, str)
Expand Down
5 changes: 5 additions & 0 deletions metadata.toml.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
"display_profile_photo": {
"type": "boolean",
"description": "Display profile photo or not"
},
"info_font_size": {
"type": "string",
"description": "Font size for personal info",
"pattern": "^[0-9]+pt$"
}
},
"required": ["header_align", "display_profile_photo"]
Expand Down
1 change: 1 addition & 0 deletions template/metadata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ language = "en"

# Decide if you want to display profile photo or not
display_profile_photo = true
info_font_size = "8pt"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if a comment could be placed above the new item.


[layout.entry]
# Decide if you want to put your company in bold or your position in bold
Expand Down
Loading