From c2724578f5024d3b73e57862720220d624d6bd83 Mon Sep 17 00:00:00 2001 From: Reorx Date: Tue, 7 Feb 2023 01:12:34 +0800 Subject: [PATCH] complete (mostly) reorx theme --- src/scss/print.css | 3 +- src/themes/data.js | 10 ++- src/themes/reorx/index.ejs | 143 ++++++++++++++++++++++-------------- src/themes/reorx/index.scss | 108 +++++++++++++++++++++------ 4 files changed, 183 insertions(+), 81 deletions(-) diff --git a/src/scss/print.css b/src/scss/print.css index d358695..64c550a 100644 --- a/src/scss/print.css +++ b/src/scss/print.css @@ -28,7 +28,8 @@ body { } } -.page-unit { +.page-unit, +.section-item { page-break-inside: avoid; page-break-after: auto; } diff --git a/src/themes/data.js b/src/themes/data.js index 125395c..f99b183 100644 --- a/src/themes/data.js +++ b/src/themes/data.js @@ -7,13 +7,17 @@ export function getRenderData(cvData) { fn: { reformatDate, getIconSVG, - urlNoSchema, + noSchemaURL, } } } /* fn */ -function urlNoSchema(url) { - return url.replace(/https?:\/\//, '') +function noSchemaURL(url) { + url = url.replace(/https?:\/\//, '') + if (url.endsWith('/')) { + url = url.slice(0, -1) + } + return url } diff --git a/src/themes/reorx/index.ejs b/src/themes/reorx/index.ejs index c250ac0..8c5566a 100644 --- a/src/themes/reorx/index.ejs +++ b/src/themes/reorx/index.ejs @@ -1,17 +1,21 @@ +<% +function linkInDiv(url) { + if (!url) return '' + return `
${fn.noSchemaURL(url)}
` +} +%> +

<%= cv.basics.name %>

<% if (cv.basics.label) { %> -
<%= cv.basics.label %>
- <% } %> - <% if (cv.basics.url) { %> - +
<%= cv.basics.label %>
<% } %> + <%- linkInDiv(cv.basics.url) %> <% if (cv.basics.summary) { %>
<%= cv.basics.summary %>
<% } %> -
+
<% if (cv.basics.email) { %>
<%- fn.getIconSVG('mdi:email') %> @@ -33,33 +37,43 @@
+ <% function dateRange(item, preserveDay) { let {startDate, endDate} = item if (!startDate && !endDate) return '' if (!preserveDay) { - const format = 'YYYY-MM' + const format = 'MMM YYYY' startDate = fn.reformatDate(startDate, format) endDate = fn.reformatDate(endDate, format) } - return `

${startDate}~${endDate}

` + return `
${startDate} – ${endDate}
` } %> <% if (cv.education) { %> -
+

Educations

<% for (const item of cv.education) { %> -
-

<%= item.institution %>

-

<%= item.url %>

-

<%= item.area %>

-

<%= item.score %>

- <%- dateRange(item) %> +
+
+

<%= item.institution %>

+ <%- dateRange(item) %> +
+
+ <%= item.studyType %>, <%= item.area %> +
+
Overall GPA: <%= item.score %>
+ <% if (item.courses && item.courses.length > 0) { %> +
+ Courses: <%= item.courses.join('; ') %> +
+ <% } %> + <%- linkInDiv(item.url) %>
<% } %>
@@ -67,23 +81,29 @@ function dateRange(item, preserveDay) { <% if (cv.work) { %> -
+

Work

<% for (const item of cv.work) { %> -
-

<%= item.name %>

-

<%= item.url %>

- <%- dateRange(item) %> -

<%= item.position %>

-
<%= item.summary %>
-
- <% for (const hl of item.highlights) { %> -
<%= hl %>
- <% } %> +
+
+

<%= item.name %>

+ <%- dateRange(item) %>
+
<%= item.position %>
+
<%= item.summary %>
+ <% if (item.highlights && item.highlights.length > 0) { %> +
+
    + <% for (const hl of item.highlights) { %> +
  • <%= hl %>
  • + <% } %> +
+
+ <% } %> + <%- linkInDiv(item.url) %>
<% } %>
@@ -91,27 +111,33 @@ function dateRange(item, preserveDay) { <% if (cv.projects) { %> -
+

Projects

<% for (const item of cv.projects) { %> -
-

<%= item.name %>

-

<%= item.url %>

-

<%= item.description %>

- <%- dateRange(item) %> -
- <% for (const hl of item.highlights) { %> -
<%= hl %>
- <% } %> +
+
+

<%= item.name %>

+ <%- dateRange(item) %>
+
<%= item.description %>
+ <% if (item.highlights && item.highlights.length > 0) { %> +
+
    + <% for (const hl of item.highlights) { %> +
  • <%= hl %>
  • + <% } %> +
+
+ <% } %>
<% for (const kw of item.keywords) { %> <%= kw %> <% } %>
+ <%- linkInDiv(item.url) %>
<% } %>
@@ -119,22 +145,26 @@ function dateRange(item, preserveDay) { <% if (cv.sideProjects) { %> -
+

Side-projects

<% for (const item of cv.sideProjects) { %> -
+

<%= item.name %>

<%= item.url %>

<%= item.description %>

<%- dateRange(item) %> -
- <% for (const kw of item.keywords) { %> - <%= kw %> - <% } %> -
+ <% if (item.keywords && item.keywords.length > 0) { %> + + <% } %> +
+ <% for (const kw of item.keywords) { %> + <%= kw %> + <% } %> +
+
<% } %>
@@ -142,36 +172,41 @@ function dateRange(item, preserveDay) { <% if (cv.skills) { %> -
+

Skills

+
<% for (const item of cv.skills) { %> -
+

<%= item.name %>

-
<%= item.level %>
-
- <% for (const kw of item.keywords) { %> - <%= kw %> - <% } %> -
+
<%= item.level %>
+ <% if (item.keywords && item.keywords.length > 0) { %> + + <% } %> +
+ <% for (const kw of item.keywords) { %> + <%= kw %> + <% } %> +
<% } %> +
<% } %> <% if (cv.languages) { %> -
+

Languages

<% for (const item of cv.languages) { %> -
+

<%= item.language %>

-
<%= item.fluency %>
+
<%= item.fluency %>
<% } %>
diff --git a/src/themes/reorx/index.scss b/src/themes/reorx/index.scss index 83ee673..dcaacb8 100644 --- a/src/themes/reorx/index.scss +++ b/src/themes/reorx/index.scss @@ -1,5 +1,10 @@ $color-signature: #2A3FFB; $color-text-dim: #777; +$fz-1: 36px; +$fz-2: 22px; +$fz-3: 18px; +$fz-4: 16px; +$lh-para: 1.4; .cv-container { font-size: 14px; @@ -15,23 +20,85 @@ $color-text-dim: #777; } } +section { + .section-title { + margin-top: 3em; + display: flex; + h2 { + font-size: $fz-2; + font-weight: 600; + color: $color-signature; + margin: 0; + } + .line { + flex-grow: 1; + margin: 14px 0 0 1em; + height: 2px; + background-color: $color-signature; + } + } + + .section-item { + margin-top: 1.5em; + + h3 { + font-size: $fz-3; + margin: 0; + } + + ul { + margin: .8em 0; + padding-left: 16px; + li { + margin-bottom: .4em; + } + } + } + + .row { + margin: .4em 0; + } + .space-between { + display: flex; + justify-content: space-between; + } + .lh-para { + line-height: $lh-para; + } + .fz-4 { + font-size: $fz-4; + } + + .keywords { + display: flex; + .item { + font-size: 13px; + color: $color-text-dim; + margin-right: .8em; + padding: 0 4px; + height: 22px; + line-height: 21px; + background: #f4f4f4; + } + } + + .two-columns { + display: grid; + grid-template-columns: 1fr 1fr; + } +} + .basics-section { h1 { - font-size: 36px; + font-size: $fz-1; font-weight: 600; margin: .2em 0 .2em 0; } - .label { - margin: .4em 0; - } - .url { - margin: .4em 0; - } .summary { - margin: .4em 0; + margin: .8em 0; + line-height: $lh-para; } .contact { - margin: .4em 0; color: $color-text-dim; display: flex; @@ -47,19 +114,14 @@ $color-text-dim: #777; } } -.section-title { - margin-top: 3em; - display: flex; - h2 { - font-size: 22px; - font-weight: 600; - color: $color-signature; - margin: 0; - } - .line { - flex-grow: 1; - margin: 14px 0 0 1em; - height: 2px; - background-color: $color-signature; +.education-section { +} + +.work-section { +} + +.skills-section { + .section-item { + } }