From 8ca2d2612b20e3e2bc3fb9ee6f3597eda0532f58 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Thu, 25 Aug 2022 13:32:23 +0200 Subject: [PATCH] feat: attempt to generate an anonymous resume as an option --- src/Controller/ResumeController.php | 5 ++++- templates/cv.tex | 16 +++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Controller/ResumeController.php b/src/Controller/ResumeController.php index 4d62f52..0e7b488 100644 --- a/src/Controller/ResumeController.php +++ b/src/Controller/ResumeController.php @@ -37,8 +37,11 @@ class ResumeController extends AbstractController 'tag_comment' => ['(!', '!)'], 'tag_variable' => ['((', '))'], ])); + $out = $twig->load('cv.tex')->render([ - ...$resume + ...$resume, + // Allow to generate annonymized resume/CV (sort of) + 'anno' => in_array(($request->getQueryParams()['anno'] ?? false), ['true', 'yes']) ]); $response->getBody()->write($out); diff --git a/templates/cv.tex b/templates/cv.tex index 86a2f6b..ba959e3 100644 --- a/templates/cv.tex +++ b/templates/cv.tex @@ -38,7 +38,7 @@ \fancyhfoffset{0em} \fancyfoot{} \fancyfoot[L]{(( misc.updated_at | format_date(locale=getLocale()) ))} -\fancyfoot[C]{(( firstName )) (( lastName )) - CV} +\fancyfoot[C]{(% if anno %)CV annonyme(% else %)(( firstName )) (( lastName )) - CV(% endif %)} \fancyfoot[R]{\thepage} \newcommand\link[2]{\color{linkcolor}\href{#1}{#2}\color{Black} } @@ -126,6 +126,9 @@ \begin{document} % \section{\color{accentcolor} \textsc{Hello World}}{Hello world} + (% if anno %) + \noindent\color{accentcolor}\textbf{\large{(( getDynLocalizedStr(label) ))}}\color{black} + (% else %) \begin{minipage}{\dimexpr\linewidth-3cm} \noindent{\huge{((firstName)) \textbf{((lastName))}}} \vspace{5px} @@ -136,20 +139,17 @@ \\ \iconwithtext{icons/cake.svg}{(( getLocalizedStr('intro.age-raw') | format(age) ))} \\ - % \sociallink{\includesvg[width=10pt,height=9pt]{./public/imgs/icons/robot.svg}}{https://matthieubessat.fr}{matthieubessat.fr} \iconwithtext{icons/at.svg}{\link{mailto:(( email ))}{(( email ))}} \iconwithtext{icons/phone.svg}{\link{(( phone | replace({' ':''}) ))}{(( phone ))}} \\ \iconwithtext{icons/link.svg}{\link{(( website ))}{(( website_alt ))}} \iconwithtext{logos/github.svg}{\link{(( links_by_ids.github.url ))}{(( links_by_ids.github.username ))}} \iconwithtext{logos/gitlab.svg}{\link{(( links_by_ids.gitlab.url ))}{(( links_by_ids.gitlab.username ))}} - % Website, Email, Location, Age - - % \includesvg[width=\svgsize]{./public/imgs/icons/robot.svg} \end{minipage} \begin{minipage}{3cm} \tikz\path[fill overzoom image={\@photo}]circle[radius=0.45\linewidth]; \end{minipage} + (% endif %) \\ \vspace{8px} \par{(( getDynLocalizedStr(intro) | raw ))} @@ -197,14 +197,16 @@ (% for exp in side_projects %) \begin{minipage}[t]{\dimexpr(\linewidth) - 1.5em} - (% if exp.detailled %) + (% if exp.detailled and not anno %) \link{(( website ))/(( getLocale() ))/projects/(( exp.id )).html}{% (% endif %) \textbf{\textsc{(( getDynLocalizedStr(exp.name) | raw ))}}% (% if exp.detailled %)}(% endif %) \hfill \textsc{(( exp.date | format_date(locale=getLocale(), pattern='YYYY') ))}\smallskip\\ + (% if not anno %) \iconwithtext{(( exp.link_icon ))}{\link{(( exp.link ))}{(( exp.link_alt ))}} \vspace{.4em} + (% endif %) \\ (( getDynLocalizedStr(exp.description) | raw ))\vspace{.4em}\\ \footnotesize{(% for t in exp.technologies %)\cvtag{(( t.name ))}(% endfor %)}\\ @@ -268,5 +270,5 @@ \keywordsentry{(( getLocalizedStr(lang.long) ))}{(( getLocalizedStr('fluency.' ~ lang.level) ))} (% endfor %) \end{keywords} - \end{document} +