Skip to content

Commit

Permalink
Follow recommended template structure
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpf committed Mar 27, 2024
1 parent ee76dfc commit 0dc5322
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 33 deletions.
File renamed without changes
50 changes: 37 additions & 13 deletions lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,19 @@
)
}

#let header(data) = {
#let header(author, job-title, bio: none, avatar: none, contact-options: ()) = {
let avatarImagePath = ""
if avatar != none {
avatarImagePath = avatar
}
grid(
columns: 1,
rows: (auto, auto),
headerRibbon(
colors.primary,
headline(data.name, data.jobTitle, data.at("bio", default: ""), imagepath: data.at("avatarImagePath", default: ""))
headline(author, job-title, bio, imagepath: avatarImagePath)
),
headerRibbon(
colors.secondary,
contactDetails(data.at("contactOptions", default: ()))
)
headerRibbon(colors.secondary, contactDetails(contact-options))
)
}

Expand Down Expand Up @@ -171,8 +172,31 @@
}


#let modern-resume(data, body) = {
// Configuration
#let modern-resume(
// The person's full name as a string.
author: "John Doe",

// A short description of your profession.
job-title: [Data Scientist],

// A short description about your background/experience/skills, or none.
bio: none,
// A avatar that is pictures in the top-right corner of the resume, or none.
avatar: none,

// A list of contact options.
contact-options: (),

// The resume's content.
body
) = {
// Set document metadata.
set document(title: "Resume of " + author, author: author)

// Set the body font.
set text(font: "Roboto", size: textSize.normal)

// Configure the page.
set page(
paper: "a4",
margin: (
Expand All @@ -182,12 +206,11 @@
bottom: 1cm,
),
)
set text(
font: "Roboto",
size: textSize.normal,
)

// Set the marker color for lists.
set list(marker: (text(colors.accentColor)[•], text(colors.accentColor)[--]))

// Set the heading.
show heading: it => {
set text(colors.accentColor)
pad(bottom: 0.5em)[
Expand All @@ -202,8 +225,9 @@
show link: it => [
#it #linkIcon("arrow-up-right-from-square")
]
header(data)
header(author, job-title, bio: bio, avatar: avatar, contact-options: contact-options)
}

// Main content
{
show link: it => [
Expand Down
18 changes: 8 additions & 10 deletions main.typ
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#import "modern-resume.typ": modern-resume, workExperience, educationalExperience, project, pill

#let data = (
name: "John Doe",
jobTitle: "Data Scientist",
bio: lorem(5), // Optional parameter
avatarImagePath: "template/avatar.png", // Optional parameter
contactOptions: ( // Optional parameter, all entries are optional
#import "lib.typ": modern-resume, workExperience, educationalExperience, project, pill

#show: modern-resume.with(
author: "John Doe",
job-title: "Data Scientist",
bio: lorem(5),
avatar: "avatar.png",
contact-options: (
email: link("mailto:john.doe@gmail.com")[john.doe\@gmail.com],
mobile: "+43 1234 5678",
location: "Austria",
Expand All @@ -15,8 +15,6 @@
),
)

#show: doc => modern-resume(data, doc)

== Education

#educationalExperience(
Expand Down
16 changes: 6 additions & 10 deletions template/main.typ
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#import "@preview/modern-resume:0.1.0": modern-resume, workExperience, educationalExperience, project, pill

#let data = (
name: "John Doe",
jobTitle: "Data Scientist",
bio: lorem(5), // Optional parameter
avatarImagePath: "avatar.png", // Optional parameter
contactOptions: ( // Optional parameter, all entries are optional
#show: modern-resume.with(
author: "John Doe",
job-title: "Data Scientist",
bio: lorem(5),
avatar: "avatar.png",
contact-options: (
email: link("mailto:john.doe@gmail.com")[john.doe\@gmail.com],
mobile: "+43 1234 5678",
location: "Austria",
Expand All @@ -15,8 +13,6 @@
),
)

#show: doc => modern-resume(data, doc)

== Education

#educationalExperience(
Expand Down

0 comments on commit 0dc5322

Please # to comment.