Add sidebar to document

This commit is contained in:
Marty Oehme 2024-09-17 17:50:30 +02:00
parent 43549c1f53
commit 5df8458b72
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

179
cv.typ
View file

@ -17,6 +17,13 @@
"en"
}
}
#let sel_word_lang(de: "", en:"") = {
if lang == "de" {
de
} else {
en
}
}
#let _columns_3(left_body, center_body, right_body) = {
block[
@ -108,31 +115,34 @@
[#par(item.abstract.at(lang))]
}
#let sel_word_lang(de: "", en:"") = {
if lang == "de" {
de
} else {
en
}
}
// Old-style presentation of skills and qualifications, to be overhauled
#let skill_item(item: ()) = {
[*#item.at(lang)*: \ ]
for skill in item.content {
[#skill.name.at(lang) (]
for (i, v) in skill.items.enumerate() {
[#v.at(lang)]
if i < skill.items.len() - 1 {
[, ]
// skill-specific entry, changing its style for sidebar
#let skill_item(item: (), is_sidebar: false) = {
let side_list(body) = if is_sidebar {list(body)} else {par(body)}
for skill in item {
side_list({
[*#skill.name.at(lang)*]
if is_sidebar [\ ] else [ (]
for (i,v) in skill.items.enumerate() {
[#v.at(lang)]
if i < skill.items.len() - 1 {
[, ]
}
}
}
[) \ ]
if not is_sidebar [)]
})
}
}
#let resume(contents) = {
// Feel free to change the margin below to best fit your own CV
#let cv(contents) = {
set text(lang: lang)
let date_formatting = {
if lang == "de" {
"[day]. [month repr:long] [year]"
} else {
"[month repr:long] [day], [year]"
}
}
set page(
paper: "a4",
margin: (x: 0.9cm, y: 1.3cm),
@ -142,14 +152,9 @@
size: 8pt,
)
#_columns_3[
#smallcaps[#datetime.today().display("[month repr:long] [day], [year]")]
#smallcaps[#datetime.today().display(date_formatting)]
][
#smallcaps[
// FIXME: Source from about.fullname variable
Marty Oehme
// #sym.dot.c
// CV
]
#smallcaps[#contents.about.fullname]
][
#counter(page).display()
]
@ -160,38 +165,106 @@
header(contents.about)
if "summary" in contents {
section(title:"", {
contents.summary.at(lang)
})
};
let body = {
if "summary" in contents {
section(title:"", {
contents.summary.at(lang)
})
};
if "experience" in contents {
let title = sel_word_lang(en:"Professional Experience", de:"Berufserfahrung")
section(title: title, entries:contents.experience)[]
if "experience" in contents {
let title = sel_word_lang(en:"Professional Experience", de:"Berufserfahrung")
section(title: title, entries:contents.experience)[]
}
if "education" in contents {
let title = sel_word_lang(en:"Education", de:"Ausbildung")
section(title: title, entries:contents.thesis + contents.education)[]
}
if "volunteering" in contents {
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
section(title: title, entries:contents.volunteering)[]
}
if "skills" in contents {
let title = sel_word_lang(en:"Qualifications", de:"Qualifikationen")
section(title: title, {
skill_item(item:contents.skills)
})
}
if "languages" in contents {
let title = sel_word_lang(en:"Languages", de:"Sprachen")
section(title: title, {
skill_item(item:contents.languages)
})
}
}
if "education" in contents {
let title = sel_word_lang(en:"Education", de:"Ausbildung")
section(title: title, entries:contents.thesis + contents.education)[]
}
if "volunteering" in contents {
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
section(title: title, entries:contents.volunteering)[]
}
if "skills" in contents {
let title = sel_word_lang(en:"Qualifications", de:"Qualifikationen")
section(title: "Qualifications", {
for cat in contents.skills {
skill_item(item:cat)
let sidebar = {
if "volunteering" in contents {
let title = sel_word_lang(en:"Volunteer Work", de:"Ehrenamt")
[== #title]
for e in contents.volunteering {
[
- *#e.title.at(lang)* (#e.date.at(lang))
#par(e.bullets.at(0).at(lang)) \
]
}
})
}
if "languages" in contents {
let title = sel_word_lang(en:"Languages", de:"Sprachen")
[== #title]
skill_item(item:contents.languages, is_sidebar: true)
[\ ]
}
if "skills" in contents {
let title = sel_word_lang(en:"Qualifications", de:"Kenntnisse")
[== #title]
skill_item(item:contents.skills, is_sidebar: true)
}
}
let margin = 1pt
grid(
columns: (2fr, 1fr),
block(outset: 0pt, inset: (top: 0.4 * margin, right: 0pt, rest: margin), stroke: none, width: 100%, {
set block(above: 10pt)
show heading.where(level: 1): it => style(s => {
let h = text(size: 18pt, upper(it))
let dim = measure(h, s)
stack(
dir: ltr,
h,
place(
dy: 7pt,
dx: 10pt,
horizon + left,
line(stroke: accent-color, length: 100% - dim.width - 10pt)
),
)
})
body
}),
{
v(20pt)
set block(inset: (left: 20 * margin, right: 20 * margin))
show heading: it => align(right, upper(it))
set list(marker: "")
show list: it => {
set par(justify: false)
align(right, block(it))
}
sidebar
}
)
}
#resume(
#cv(
yaml("content.yml")
)