From 853e2164355813083d692eaeb62f01624d758075 Mon Sep 17 00:00:00 2001 From: Ingemar Berg <73386284+ingemarberg@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:56:56 +0100 Subject: [PATCH] Add option to force HTTP to homepage --- moderncv.cls | 5 +++-- moderncvfooti.sty | 6 ++++-- moderncvheadi.sty | 6 ++++-- moderncvheadii.sty | 3 ++- moderncvheadiii.sty | 6 ++++-- moderncvheadiv.sty | 6 ++++-- moderncvheadv.sty | 6 ++++-- moderncvheadvi.sty | 3 ++- 8 files changed, 27 insertions(+), 14 deletions(-) diff --git a/moderncv.cls b/moderncv.cls index 8c145b2..7c76e2a 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -233,8 +233,9 @@ \newcommand*{\email}[1]{\def\@email{#1}} % defines one's home page (optional) -% usage: \homepage{} -\newcommand*{\homepage}[1]{\def\@homepage{#1}} +% usage: \homepage[]{} +% where should be either "https" (default) or "http" +\NewDocumentCommand{\homepage}{O{https}m}{\def\@homepageprotocol{#1}\def\@homepage{#2}} % adds a fixed/mobile/fax number to one's personal information (optional) % usage: \phone[]{} diff --git a/moderncvfooti.sty b/moderncvfooti.sty index 3703658..03d84c1 100644 --- a/moderncvfooti.sty +++ b/moderncvfooti.sty @@ -89,7 +89,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \addtofoot{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@email}}{}{\addtofoot{\emailsymbol\emaillink{\@email}}}% - \ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol\httpslink{\@homepage}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \addtofoot{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtofoot{\@extrainfo}}% @@ -121,7 +122,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \addtofoot{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@email}}{}{\addtofoot{\emailsymbol\emaillink{\@email}}}% - \ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol\httpslink{\@homepage}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \addtofoot{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtofoot{\@extrainfo}}% diff --git a/moderncvheadi.sty b/moderncvheadi.sty index b625f4a..51d9737 100644 --- a/moderncvheadi.sty +++ b/moderncvheadi.sty @@ -86,7 +86,8 @@ \ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol\@born}% \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}% \end{tabular} @@ -169,7 +170,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}% \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi% \end{minipage}\\[2em] % recipient block diff --git a/moderncvheadii.sty b/moderncvheadii.sty index 67ff3ba..7f484c8 100644 --- a/moderncvheadii.sty +++ b/moderncvheadii.sty @@ -144,7 +144,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}% - \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httpslink{\@homepage}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}% diff --git a/moderncvheadiii.sty b/moderncvheadiii.sty index eabe820..7bec702 100644 --- a/moderncvheadiii.sty +++ b/moderncvheadiii.sty @@ -95,7 +95,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}% - \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httpslink{\@homepage}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}% @@ -147,7 +148,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}% \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi% \end{minipage}\\[2em] % recipient block diff --git a/moderncvheadiv.sty b/moderncvheadiv.sty index cfb0fd0..1d24c96 100644 --- a/moderncvheadiv.sty +++ b/moderncvheadiv.sty @@ -111,7 +111,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}% \ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi} @@ -159,7 +160,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}% \ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}}% diff --git a/moderncvheadv.sty b/moderncvheadv.sty index 3afd757..936ec79 100644 --- a/moderncvheadv.sty +++ b/moderncvheadv.sty @@ -83,7 +83,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \makenewline\csname\collectionloopkey phonesymbol\endcsname~\collectionloopitem}% \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol~\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol~\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol~% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \makenewline\csname\collectionloopkey socialsymbol\endcsname~\collectionloopitem}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}\fi}% @@ -146,7 +147,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}% \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi% \end{minipage}\\[2em] % recipient block diff --git a/moderncvheadvi.sty b/moderncvheadvi.sty index abda829..e532f9a 100644 --- a/moderncvheadvi.sty +++ b/moderncvheadvi.sty @@ -116,7 +116,8 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}% - \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httpslink{\@homepage}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}%