Skip to content

Commit

Permalink
cv-x-wing-create-about-me-section
Browse files Browse the repository at this point in the history
  • Loading branch information
MTeresaMB committed Dec 7, 2023
1 parent 2cb3a32 commit db01b83
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<%_ if (profile && profile !== 'undefined' ) { -%>
<section class="main__section about-me__section">
<div class="main__section__header">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="6" viewBox="0 0 32 6" fill="none">
<path d="M5.51343e-07 3L32 3" stroke="#3BA0B7" stroke-width="6" />
</svg>
<h2>Sobre mi</h2>
</div>
<p><%= profile?.description %></p>
</section>
<%_ } -%>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import ejs from 'ejs';
import { ProfileSectionVm, mapFromMacCvToProfileSectionVm } from '@lemoncode/manfred-common/profile-section';
import { ManfredAwesomicCV } from '@/model';
import aboutMeSection from './about-me-section.ejs?raw';

export const generateAboutMeSection = (cv: ManfredAwesomicCV): string => {
const profileSectionVm = mapFromMacCvToProfileSectionVm(cv);
return generateAboutMeSectionInner(profileSectionVm);
};

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

return ejs.render(aboutMeSection, rootObject);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './about-me-section.part';
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ export * from './html-document-end';
export * from './header-element-start';
export * from './header-element-end';
export * from './header-section';
export * from './main-element-start';
export * from './main-element-end';
export * from './about-me-section';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './main-element-end.part';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
</main>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import ejs from 'ejs';
import mainElementEndTemplate from './main-element-end.ejs?raw';

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

export const generateMainElementStart = (): string => ejs.render(mainElementTemplate);
10 changes: 9 additions & 1 deletion packages/manfred2html/src/engine/cv-x-wing-squadron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
generateHeaderElementEnd,
generateHeaderElementStart,
generateHeaderSection,
generateMainElementStart,
generateAboutMeSection,
generateMainElementEnd,
} from './html-parts';

export const exportManfredJsonToCVXWingHTML = (manfredJsonContent: ManfredAwesomicCV): string => {
Expand All @@ -13,12 +16,17 @@ export const exportManfredJsonToCVXWingHTML = (manfredJsonContent: ManfredAwesom
const headerElementStart = generateHeaderElementStart();
const headerElementEnd = generateHeaderElementEnd();
const headerSection = generateHeaderSection(manfredJsonContent);

const mainElementStart = generateMainElementStart();
const aboutMeSection = generateAboutMeSection(manfredJsonContent);
const mainElementEnd = generateMainElementEnd();
return `
${htmlDocumentStart}
${headerElementStart}
${headerSection}
${headerElementEnd}
${mainElementStart}
${aboutMeSection}
${mainElementEnd}
${htmlDocumentEnd}
`;
};

0 comments on commit db01b83

Please sign in to comment.