From b56fb1d31fea1595bc4c103ab3f6966ecf5cb6ab Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sun, 1 Oct 2023 22:21:07 +0200 Subject: [PATCH] add last updated date to the header --- rendercv/data_model.py | 10 ++++++++++ rendercv/templates/classic.tex.j2 | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/rendercv/data_model.py b/rendercv/data_model.py index d74fb13..941c88b 100644 --- a/rendercv/data_model.py +++ b/rendercv/data_model.py @@ -371,6 +371,15 @@ class ClassicThemeOptions(BaseModel): ), ) + show_last_updated_date: bool = Field( + default=True, + title="Show Last Updated Date", + description=( + "If this option is set to true, then the last updated date will be shown" + " in the header." + ), + ) + margins: ClassicThemeMargins = Field( default=ClassicThemeMargins(), title="Margins", @@ -610,6 +619,7 @@ class Event(BaseModel): return month_and_year + class OneLineEntry(Event): """This class stores [OneLineEntry](../index.md#onelineentry) information.""" diff --git a/rendercv/templates/classic.tex.j2 b/rendercv/templates/classic.tex.j2 index 3657bcc..d15567c 100644 --- a/rendercv/templates/classic.tex.j2 +++ b/rendercv/templates/classic.tex.j2 @@ -28,6 +28,8 @@ colorlinks=true, urlcolor=primaryColor ]{hyperref} % for links, metadata and bookmarks +\usepackage[pscoord]{eso-pic} % for floating text on the page +\usepackage{calc} % for calculating lengths % Some settings: \pagestyle{empty} % no header or footer @@ -94,9 +96,20 @@ \par\kern\topsep } % new environment for the header +\newcommand{\placelastupdatedtext}{% \placetextbox{}{}{} + \AddToShipoutPictureFG*{% Add to current page foreground + \put(\LenToUnit{\paperwidth-0.5cm},\LenToUnit{\paperheight-0.5cm}){\vtop{{\null}\makebox[0pt][c]{ + \small\color{gray}\emph{Last updated on \printdayon\today} \hspace{\widthof{Last updated on \printdayon\today}}}}}% + }% +}% + \newcommand{\hrefExternal}[2]{\href{#1}{#2\, \raisebox{.1ex}{\footnotesize \faExternalLink*}}} % new command for external links \begin{document} +((* if design.show_last_updated_date *)) + \placelastupdatedtext +((* endif *)) + <> ((* for section in cv.sections *))