Skip to content

Commit

Permalink
contact section
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelDeTena committed Jan 16, 2024
1 parent c9945fb commit 373ef89
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
</aside>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import ejs from 'ejs';
import asideElementEnd from './aside-element-end.ejs?raw';

export const generateAsideElementEnd = (): string => ejs.render(asideElementEnd);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './aside-element-end.part';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<aside>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import ejs from 'ejs';
import asideElementStart from './aside-element-start.ejs?raw';

export const generateAsideElementStart = (): string => ejs.render(asideElementStart);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './aside-element-start.part';
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<%_ if (profile.relevantLinks && profile.relevantLinks !== 0) { -%>
<h2>Contact</h2>
<div class="aside__container">
<%_ for (const link of profile?.relevantLinks) { -%>
<%_ if (link.type === 'phone') { -%>
<div class="aside__container__item">
<div>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M1.5 2.3125C1.5 1.86377 1.86377 1.5 2.3125 1.5H4.06171C4.45889 1.5 4.79786 1.78715 4.86315 2.17893L5.46385 5.78307C5.52249 6.13491 5.3448 6.48385 5.02576 6.64337L3.7679 7.2723C4.67489 9.52614 6.47387 11.3251 8.7277 12.2321L9.35663 10.9742C9.51615 10.6552 9.86509 10.4775 10.2169 10.5362L13.8211 11.1368C14.2129 11.2021 14.5 11.5411 14.5 11.9383V13.6875C14.5 14.1362 14.1362 14.5 13.6875 14.5H12.0625C6.22899 14.5 1.5 9.77101 1.5 3.9375V2.3125Z"
fill="#DAD6D1"
/>
</svg>
</div>
<a href="tel:+#">+1 041 234 5678</a>
</div>
<%_ } -%>
<%_ if (link.type === 'email') { -%>
<div class="aside__container__item">
<div>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M2.26375 4.93939C1.78863 5.23634 1.5 5.7571 1.5 6.31738V12.7292C1.5 13.6267 2.22754 14.3542 3.125 14.3542H12.875C13.7725 14.3542 14.5 13.6267 14.5 12.7292V6.31738C14.5 5.7571 14.2114 5.23634 13.7362 4.93939L8.86125 1.89251C8.33431 1.56317 7.66569 1.56317 7.13875 1.89251L2.26375 4.93939ZM4.38819 6.90744C4.01483 6.65852 3.51037 6.75942 3.26146 7.13278C3.01255 7.50615 3.11344 8.01061 3.48681 8.25952L7.54931 10.9679C7.82222 11.1498 8.17778 11.1498 8.45069 10.9679L12.5132 8.25952C12.8866 8.01061 12.9875 7.50615 12.7385 7.13278C12.4896 6.75942 11.9852 6.65852 11.6118 6.90744L8 9.31531L4.38819 6.90744Z"
fill="#DAD6D1"
/>
</svg>
</div>
<a href="mailto:#">user@email.com</a>
</div>
<%_ } %>
<%_ if (link.type === 'linkedin') { -%>
<div class="aside__container__item">
<div>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1874_491)">
<path
d="M14.8156 0H1.18125C0.528125 0 0 0.515625 0 1.15313V14.8438C0 15.4813 0.528125 16 1.18125 16H14.8156C15.4688 16 16 15.4813 16 14.8469V1.15313C16 0.515625 15.4688 0 14.8156 0ZM4.74687 13.6344H2.37188V5.99687H4.74687V13.6344ZM3.55938 4.95625C2.79688 4.95625 2.18125 4.34062 2.18125 3.58125C2.18125 2.82188 2.79688 2.20625 3.55938 2.20625C4.31875 2.20625 4.93437 2.82188 4.93437 3.58125C4.93437 4.3375 4.31875 4.95625 3.55938 4.95625ZM13.6344 13.6344H11.2625V9.92188C11.2625 9.0375 11.2469 7.89687 10.0281 7.89687C8.79375 7.89687 8.60625 8.8625 8.60625 9.85938V13.6344H6.2375V5.99687H8.5125V7.04063H8.54375C8.85938 6.44063 9.63438 5.80625 10.7875 5.80625C13.1906 5.80625 13.6344 7.3875 13.6344 9.44375V13.6344Z"
fill="#DAD6D1"
/>
</g>
<defs>
<clipPath id="clip0_1874_491">
<rect width="16" height="16" fill="white" />
</clipPath>
</defs>
</svg>
</div>
<a href="#" target="_blank">https://linkedin.com/in/david-bonilla</a>
</div>
<%_ } %>
<%_ if (link.type === 'github') { -%>
<div class="aside__container__item">
<div>
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M8.20312 0C3.6709 0 0 3.67295 0 8.20312C0 11.8282 2.35019 14.9023 5.60888 15.9858C6.01904 16.0631 6.16943 15.8095 6.16943 15.5914C6.16943 15.3966 6.16259 14.8805 6.15917 14.1969C3.87734 14.6918 3.39609 13.0963 3.39609 13.0963C3.02285 12.1495 2.48349 11.8966 2.48349 11.8966C1.74043 11.388 2.54092 11.3982 2.54092 11.3982C3.36465 11.4557 3.79736 12.2432 3.79736 12.2432C4.5288 13.4975 5.71757 13.1352 6.18652 12.9254C6.26035 12.3949 6.47158 12.0333 6.70605 11.8282C4.88427 11.6231 2.96953 10.9177 2.96953 7.77451C2.96953 6.879 3.2874 6.14755 3.81377 5.57334C3.72148 5.36621 3.44463 4.53222 3.88554 3.40224C3.88554 3.40224 4.57256 3.18213 6.1414 4.24306C6.79765 4.06054 7.49492 3.97031 8.19218 3.96621C8.88945 3.97031 9.58671 4.06054 10.243 4.24306C11.8016 3.18213 12.4886 3.40224 12.4886 3.40224C12.9295 4.53222 12.6526 5.36621 12.5706 5.57334C13.0935 6.14755 13.4114 6.879 13.4114 7.77451C13.4114 10.9259 11.4939 11.6197 9.66874 11.8214C9.95585 12.0675 10.2225 12.5706 10.2225 13.339C10.2225 14.4368 10.2122 15.3186 10.2122 15.5852C10.2122 15.8006 10.3558 16.0569 10.7762 15.9749C14.0581 14.8989 16.4062 11.8227 16.4062 8.20312C16.4062 3.67295 12.7333 0 8.20312 0Z"
fill="#DAD6D1"
/>
</svg>
</div>
<a href="#" target="_blank">https://github.com/dbonilla</a>
</div>
<%_ } %>
<%_ if (link.type === 'twitter') { -%>
<div class="aside__container__item">
<div>
<svg width="16" height="15" viewBox="0 0 16 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
id="Twitter-ICON"
d="M0.0390096 0L6.21643 8.2598L0 14.9754H1.39907L6.84154 9.09578L11.2389 14.9754H16L9.47501 6.25096L15.2612 0H13.8621L8.8499 5.41498L4.8001 0H0.0390096ZM2.09644 1.03056H4.2837L13.9422 13.9446H11.755L2.09644 1.03056Z"
fill="#DAD6D1"
/>
</svg>
</div>
<a href="#" target="_blank">https://twitter/david-bonilla</a>
</div>
<%_ } %>
<%_ if (link.type === 'web') { -%>
<div class="aside__container__item">
<div>
<svg width="21" height="17" viewBox="0 0 21 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
id="Vector"
d="M19.1184 9.37362C21.0406 7.45149 21.0406 4.33865 19.1184 2.41651C17.4174 0.715508 14.7367 0.494378 12.7805 1.8926L12.7261 1.93003C12.2362 2.28043 12.1239 2.96083 12.4743 3.44732C12.8247 3.93381 13.5051 4.04948 13.9916 3.69907L14.046 3.66165C15.1381 2.88259 16.6316 3.00506 17.5773 3.95422C18.649 5.02585 18.649 6.76088 17.5773 7.83251L13.7603 11.6564C12.6886 12.728 10.9536 12.728 9.88198 11.6564C8.93282 10.7072 8.81035 9.21373 9.58941 8.12508L9.62683 8.07065C9.97724 7.58076 9.86157 6.90036 9.37508 6.55336C8.8886 6.20635 8.20479 6.31862 7.85779 6.8051L7.82037 6.85954C6.41874 8.81229 6.63987 11.4931 8.34088 13.1941C10.263 15.1162 13.3758 15.1162 15.298 13.1941L19.1184 9.37362ZM1.4416 8.57755C-0.480534 10.4997 -0.480534 13.6125 1.4416 15.5347C3.14261 17.2357 5.82339 17.4568 7.77954 16.0586L7.83398 16.0211C8.32387 15.6707 8.43613 14.9903 8.08572 14.5039C7.73532 14.0174 7.05492 13.9017 6.56843 14.2521L6.514 14.2895C5.42195 15.0686 3.92847 14.9461 2.98271 13.997C1.91108 12.9219 1.91108 11.1869 2.98271 10.1153L6.79977 6.2948C7.8714 5.22317 9.60642 5.22317 10.6781 6.2948C11.6272 7.24396 11.7497 8.73745 10.9706 9.82949L10.9332 9.88392C10.5828 10.3738 10.6985 11.0542 11.185 11.4012C11.6714 11.7482 12.3552 11.636 12.7023 11.1495L12.7397 11.095C14.1413 9.13888 13.9202 6.4581 12.2192 4.75709C10.297 2.83496 7.18419 2.83496 5.26206 4.75709L1.4416 8.57755Z"
fill="#DAD6D1"
/>
</svg>
</div>
<a href="#" target="_blank">https://www.david-bonilla.com</a>
</div>
<%_ } %>
<%_ } %>
</div>
<%_ } -%>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ManfredAwesomicCV } from '@/model';
import { ProfileSectionVm, mapFromMacCvToProfileSectionVm } from '@lemoncode/manfred-common/profile-section';
import contactSection from './contact-section.ejs?raw';
import ejs from 'ejs';

export const generateContactSection = (cv: ManfredAwesomicCV): string => {
const profileSectionVm = mapFromMacCvToProfileSectionVm(cv);

return generateContactSectionInner(profileSectionVm);
};

const generateContactSectionInner = (profileSectionVm: ProfileSectionVm): string => {
const rootObject = {
profile: profileSectionVm,
};

return ejs.render(contactSection, rootObject);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './contact-section.part';
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ export * from './header-element-end';
export * from './header-section';
export * from './right-side-start';
export * from './right-side-end';
export * from './aside-element-start';
export * from './aside-element-end';
export * from './contact-section';
11 changes: 10 additions & 1 deletion packages/manfred2html/src/engine/cv-jedi-minimalism/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {
generateHeaderSection,
generateRightDivElementStart,
generateRightDivElementEnd,
generateAsideElementStart,
generateAsideElementEnd,
generateContactSection,
} from './html-parts';

export const exportManfredJSonToCVJediMinimalismHTML = (
Expand All @@ -24,13 +27,19 @@ export const exportManfredJSonToCVJediMinimalismHTML = (
const leftSideEnd = generateLeftDivElementEnd();
const rightSideStart = generateRightDivElementStart();
const rightSideEnd = generateRightDivElementEnd();
const asideElementStart = generateAsideElementStart();
const asideElementEnd = generateAsideElementEnd();
const contactSection = generateContactSection(manfredJsonContent);

return `
${htmlDocumentStart}
${leftSideStart}
${headerElementStart}
${headerSection}
${headerElementEnd}
${headerElementEnd}
${asideElementStart}
${contactSection}
${asideElementEnd}
${leftSideEnd}
${rightSideStart}
${rightSideEnd}
Expand Down

0 comments on commit 373ef89

Please sign in to comment.