-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
91 lines (77 loc) · 2.29 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import {
sectionTitles,
headContent,
contactDetailsContent,
summaryContent,
experiencesContent,
skillsContent,
educationContent,
footerContent,
rootCssClass
} from '../../src/config';
import {
headTemplate,
asideItemTemplate,
summaryTemplate,
experienceTemplate,
skillsTemplate,
educationTemplate,
footerTemplate
} from './templates';
import {
htmlCommentBuilder,
dividerBuilder
} from '../utils';
const commentFor = {
contactDetails: htmlCommentBuilder( 'Contact Details Section' ),
summary: htmlCommentBuilder( 'Personal Summary Section' ),
experience: htmlCommentBuilder( 'Experience Section' ),
education: htmlCommentBuilder( 'Education Section' ),
skills: htmlCommentBuilder( 'Skills Section' ),
};
const head = headTemplate(headContent);
const aside = asideItemTemplate(contactDetailsContent);
const summary = summaryTemplate( summaryContent, 'p' );
const experiences = experienceTemplate( experiencesContent );
const skills = skillsTemplate(skillsContent);
const education = educationTemplate(educationContent);
const footer = footerTemplate(footerContent);
const body = `${commentFor.contactDetails}
<aside class="${rootCssClass}__aside">
${aside}
</aside>
${dividerBuilder()}
<main class="${rootCssClass}__main">
${commentFor.summary}
<section class="${rootCssClass}__summary">
<h2 class="${rootCssClass}__main-title">${sectionTitles.summary}</h2>
${summary}
</section>
${dividerBuilder()}
${commentFor.experience}
<section class="${rootCssClass}__experience">
<h2 class="${rootCssClass}__main-title">${sectionTitles.experience}</h2>
${experiences}
</section>
${dividerBuilder()}
${commentFor.education}
<section class="${rootCssClass}__education">
<h2 class="${rootCssClass}__main-title">${sectionTitles.education}</h2>
${education}
</section>
${dividerBuilder()}
${commentFor.skills}
<h2 class="${rootCssClass}__main-title">${sectionTitles.skills}</h2>
<table class="${rootCssClass}__skills">
${skills}
</table>
</main>
${footer}`;
const headAndBody = `${head}
${body}
</body>
</html>`;
export {
body,
headAndBody
};