From 40e04afed48b219c2f1840c67741d0b2da39d2ee Mon Sep 17 00:00:00 2001 From: devlinjd Date: Wed, 16 Dec 2015 20:08:12 -0500 Subject: [PATCH] Compact: Migrate to Handlebars. --- themes/compact/src/compact-html.html | 145 ++++++++++++++------------- themes/compact/src/compact-md.txt | 122 +++++++++++++--------- themes/compact/src/compact-pdf.html | 145 ++++++++++++++------------- themes/compact/src/compact-txt.txt | 114 ++++++++++++++------- 4 files changed, 301 insertions(+), 225 deletions(-) diff --git a/themes/compact/src/compact-html.html b/themes/compact/src/compact-html.html index 7743069..933ef29 100644 --- a/themes/compact/src/compact-html.html +++ b/themes/compact/src/compact-html.html @@ -12,21 +12,21 @@

{{ r.name }}

- {% if (r.contact.email) { %}{% } %} - {% if (r.contact.phone) { %}
{{ r.contact.phone }}
{% } %} - {% if (r.contact.website) { %}{% } %} + {{#if r.contact.email}}{{/if}} + {{#if r.contact.phone}}
{{ r.contact.phone }}
{{/if}} + {{#if r.contact.website}}{{/if}}
-{% if ( r.info.brief && r.info.brief.length ) { %} +{{#if r.info.brief}}
{{ r.info.brief }}
-{% } %} +{{/if}} -{% if ( r.skills && r.skills.sets && r.skills.sets.length ) { %} +{{#if r.skills}}

Skills


@@ -39,121 +39,124 @@ - {% r.skills.sets.forEach( function( skillset ) { %} + {{#each r.skills.sets}} - {{ skillset.name }} - {{ skillset.skills.join(', ') }} + {{ name }} + {{#each skills}}{{ this }} {{/each}} - {% }); %} + {{/each}}
-{% } %} +{{/if}} -{% if ( r.employment && r.employment.history ) { %} +{{#if r.employment}}

Employment


- - - {% r.employment.history.forEach( function( proj, idx, ar) { %} - {% if( idx < 4 ) { %} -

{{ proj.position }}, {{ filt.link( proj.employer, proj.url ) }} {{ proj.safe.start.format('YYYY-MM') }} — {{ proj.safe.end.format('YYYY-MM') }}

-

{{ proj.summary }}

- {% if( proj.highlights ) { %} + {{#each r.employment.history }} + {{#compare @index 4 operator="<"}} +

{{ position }}, + {{#if url }} + {{ employer }} + {{else}} + {{ employer }} + {{/if}} + {{formatDate safe.start 'YYYY-MM' }} — {{formatDate safe.end 'YYYY-MM' }}

+

{{ summary }}

+ {{#if highlights}} - {% } %} - {% } else { %} + {{/if}} + {{/compare}} + {{#compare @index 4 operator=">="}} - {% if( idx === 4 ) { %} -

Previously... {{ r.employment.history[ r.employment.history.length - 1 ].safe.start.format('YYYY') }} — {{ proj.safe.end.format('YYYY') }}

-

Prior to {{ r.employment.history[ 3 ].employer }}, I worked on a range of projects for companies large and small.

+ {{#compare @index 4 operator="=="}} +

Previously...

+

Prior to {{ employer }}, I worked on a range of projects for companies large and small.

- {% } %} - - {% } %} - {% }); %} - - + {{/if}} + {{/compare}} + {{/each}}
-{% } %} +{{/if}} - - -{% if ( r.education && r.education.history ) { %} +{{# if r.education}}

Education


- {% r.education.history.forEach( function( edu, idx, ar) { %} -

{{ edu.institution }} {{ edu.safe.start.format('YYYY') }} — {{ edu.safe.end.format('YYYY') }}

- {% }); %} + {{#each r.education.history}} +

{{ institution }} {{formatDate safe.start 'YYYY' }} — {{formatDate safe.end 'YYYY' }}

+ {{/each}}
-{% } %} +{{/if}} -{% if ( r.service && r.service.history && r.service.history.length ) { %} +{{#if r.service}}

Service


- {% r.service.history.forEach( function( vol, idx, ar ) { %} -

{{ vol.position }}, {{ filt.link(vol.organization, vol.url) }} {{ vol.safe.start.format('YYYY') }} — {{ vol.safe.end.format('YYYY') }}

-

{{ vol.summary }}

- {% if( vol.highlights ) { %} + {{#each r.service.history}} +

{{ position }}, + {{#if url}} + {{ organization }} + {{else}} + {{ organization }} + {{/if}} + {{formatDate safe.start 'YYYY' }} — {{formatDate safe.end 'YYYY' }}

+

{{ summary }}

+ {{#if highlights}} - {% } %} - {% }); %} + {{/if}} + {{/each}}
-{% } %} +{{/if}} -{% if( r.writing && r.writing.length ) { %} +{{#if r.writing}}

Writing


- {% r.writing.forEach( function( pub, idx, ar ) { %} -

{{ filt.link( pub.title, pub.url ) }}, {{ pub.publisher }} {{ pub.safe.date.format('YYYY') }}

- - {% if (pub.summary) { %}{{ pub.summary }}{% } %} - - {% }); %} + {{#each r.writing }} +

{{#if url}}{{ title }}{{else}}{{ title }}{{/if}}, + {{ publisher }} {{formatDate safe.date 'YYYY'}}

+ {{# if summary}}{{ summary }}{{/if}} + {{/each}}
-{% } %} +{{/if}} -{% if( r.recognition && r.recognition.length ) { %} +{{# if r.recognition}}

Awards


- {% r.recognition.forEach( function( award, idx, ar) { %} -

{{ award.title }}, {{ award.from }} {{ award.safe.date.format('YYYY') }}

- {{ award.summary }} - {% }); %} + {{#each r.recognition}} +

{{ title }}, {{ from }} {{formatDate safe.date 'YYYY' }}

+ {{ summary }} + {{/each}}
-{% } %} +{{/if}} diff --git a/themes/compact/src/compact-md.txt b/themes/compact/src/compact-md.txt index c22301b..6c5bba0 100644 --- a/themes/compact/src/compact-md.txt +++ b/themes/compact/src/compact-md.txt @@ -1,54 +1,84 @@ -# {{ r.name }} +{{ r.name }} +============ +{{#if r.contact.email }}Email: {{{ r.contact.email }}}{{/if}} +{{#if r.contact.phone }}Tel: {{{ r.contact.phone }}}{{/if}} +{{#if r.contact.website }}Web: {{{ r.contact.website }}}{{/if}} -{% if (r.contact.email) { %}Email: {{ r.contact.email }}{% } %} -{% if (r.contact.phone) { %}Tel: {{ r.contact.phone }}{% } %} -{% if (r.contact.website) { %}Web: {{ r.contact.website }}{% } %} +{{#if r.info.brief }}{{{ r.info.brief }}}{{/if}} -{% if ( r.info.brief && r.info.brief.length ) { %}{{ r.info.brief }}{% } %} +{{#if r.skills}} +## SKILLS -{% if ( r.skills && r.skills.sets ) { %} -## Skills -{% r.skills.sets.forEach( function( set, idx, ar) { %} -- **{{ set.name }}**: {{ set.skills.join(', ') }} -{% }); } %} +{{#each r.skills.sets}} + - {{{ name }}}: {{#each this.skills}}{{{ this }}} {{/each}} +{{/each}} +{{/if}} -{% if ( r.employment.history && r.employment.history.length ) { %} -## Employment -{% r.employment.history.forEach( function( proj, idx, ar) { %} -### *{{ proj.position }}*, {{ proj.employer }} -{{ proj.safe.start.format('MMM YYYY') }} — {{ proj.safe.end.format('MMM YYYY') }} -{{ proj.summary }} -{% if( proj.highlights ) { %}{% proj.highlights.forEach( function( high, idx, ar) { %} -- {{ high }} -{% }); } }); } %} +{{#if r.employment}} +## EMPLOYMENT -{% if ( r.education.history && r.education.history.length ) { %} -## Education -{% r.education.history.forEach( function( edu, idx, ar) { %} -### {{ edu.institution }} ({{ edu.safe.start.format('MMM YYYY') }} — {{ edu.safe.end.format('MMM YYYY') }}) -{{ edu.area }} -{% if( edu.curriculum ) { %}{% edu.curriculum.forEach( function( course, idx, ar) { %} -- {{ course }} -{% }); } }); } %} +{{#each r.employment.history }} + {{#compare @index 4 operator="<"}} +### {{{ position }}}, {{{ employer }}} ({{formatDate safe.start 'YYYY-MM' }} -- {{formatDate safe.end 'YYYY-MM' }}) +{{{ summary }}} +{{#if highlights}} +{{#each highlights}} + - {{{ this }}} +{{/each}} +{{/if}} -{% if ( r.writing && r.writing.length ) { %} -## Publications -{% r.writing.forEach( function( pub, idx, ar) { %} -### {{ pub.title }} ({{ pub.safe.date.format('MMM YYYY') }}) -{{ pub.publisher }} -{{ pub.summary }} -{% }); } %} + {{/compare}} + {{#compare @index 4 operator=">="}} + {{#compare @index 4 operator="=="}} +### Previously... +Prior to {{{ employer }}}, I worked on a range of projects for companies large and small. + {{/compare}} + - {{{ position }}}, {{{ employer }}} + {{/compare}} +{{/each}} +{{/if}} -{% if ( r.service.history && r.service.history.length ) { %} -## Volunteer -{% r.service.history.forEach( function( vol, idx, ar) { %} -### {{ vol.organization }} ({{ vol.safe.start.format('MMM YYYY') }} — {{ vol.safe.end.format('MMM YYYY') }}) -{{ vol.summary }} -{% }); } %} +{{#if r.education}} +## EDUCATION -{% if ( r.recognition && r.recognition.length ) { %} -## Recognition -{% r.recognition.forEach( function( awd, idx, ar) { %} -### *{{ awd.title }}*, {{ awd.from }} ({{ awd.safe.date.format('MMM YYYY') }}) -{{ awd.summary }} -{% }); } %} +{{#each r.education.history}} +### {{{ institution }}} ({{formatDate safe.start 'YYYY-MM' }} — {{formatDate safe.end 'YYYY-MM' }}) +{{#if summary }} +{{{ summary }}} +{{/if}} +{{#if courses}} +{{#each courses}} + - {{{ this }}}{{/each}}{{/if}} +{{/each}} +{{/if}} +{{#if r.writing}} +## WRITING + +{{#each r.writing}} +### {{{ title }}} ({{formatDate safe.date 'YYYY-MM' }}) +{{{ summary }}} +{{/each}} +{{/if}} + +{{#if r.service }} +## SERVICE + +{{#each r.service.history}} +### {{{ organization }}} ({{formatDate safe.start 'YYYY-MM' }} — {{formatDate safe.end 'YYYY-MM' }}) +{{{ summary }}} +{{#if highlights}} +{{#each highlights}} + - {{{ this }}} +{{/each}} +{{/if}} + +{{/each}} +{{/if}} +{{#if r.recognition}} +## RECOGNITION + +{{#each r.recognition}} +### {{{ title }}}, {{{ from }}} ({{formatDate safe.date 'MMM YYYY' }}) +{{{ summary }}} +{{/each}} +{{/if}} diff --git a/themes/compact/src/compact-pdf.html b/themes/compact/src/compact-pdf.html index 44a2c21..cf0c941 100644 --- a/themes/compact/src/compact-pdf.html +++ b/themes/compact/src/compact-pdf.html @@ -13,21 +13,21 @@

{{ r.name }}

- {% if (r.contact.email) { %}{% } %} - {% if (r.contact.phone) { %}
{{ r.contact.phone }}
{% } %} - {% if (r.contact.website) { %}{% } %} + {{#if r.contact.email}}{{/if}} + {{#if r.contact.phone}}
{{ r.contact.phone }}
{{/if}} + {{#if r.contact.website}}{{/if}}
-{% if ( r.info.brief && r.info.brief.length ) { %} +{{#if r.info.brief}}
{{ r.info.brief }}
-{% } %} +{{/if}} -{% if ( r.skills && r.skills.sets && r.skills.sets.length ) { %} +{{#if r.skills}}

Skills


@@ -40,121 +40,124 @@ - {% r.skills.sets.forEach( function( skillset ) { %} + {{#each r.skills.sets}} - {{ skillset.name }} - {{ skillset.skills.join(', ') }} + {{ name }} + {{#each skills}}{{ this }} {{/each}} - {% }); %} + {{/each}}
-{% } %} +{{/if}} -{% if ( r.employment && r.employment.history ) { %} +{{#if r.employment}}

Employment


- - - {% r.employment.history.forEach( function( proj, idx, ar) { %} - {% if( idx < 4 ) { %} -

{{ proj.position }}, {{ filt.link( proj.employer, proj.url ) }} {{ proj.safe.start.format('YYYY-MM') }} — {{ proj.safe.end.format('YYYY-MM') }}

-

{{ proj.summary }}

- {% if( proj.highlights ) { %} + {{#each r.employment.history }} + {{#compare @index 4 operator="<"}} +

{{ position }}, + {{#if url }} + {{ employer }} + {{else}} + {{ employer }} + {{/if}} + {{formatDate safe.start 'YYYY-MM' }} — {{formatDate safe.end 'YYYY-MM' }}

+

{{ summary }}

+ {{#if highlights}} - {% } %} - {% } else { %} + {{/if}} + {{/compare}} + {{#compare @index 4 operator=">="}} - {% if( idx === 4 ) { %} -

Previously... {{ r.employment.history[ r.employment.history.length - 1 ].safe.start.format('YYYY') }} — {{ proj.safe.end.format('YYYY') }}

-

Prior to {{ r.employment.history[ 3 ].employer }}, I worked on a range of projects for companies large and small.

+ {{#compare @index 4 operator="=="}} +

Previously...

+

Prior to {{ employer }}, I worked on a range of projects for companies large and small.

- {% } %} - - {% } %} - {% }); %} - - + {{/if}} + {{/compare}} + {{/each}}
-{% } %} +{{/if}} - - -{% if ( r.education && r.education.history ) { %} +{{# if r.education}}

Education


- {% r.education.history.forEach( function( edu, idx, ar) { %} -

{{ edu.institution }} {{ edu.safe.start.format('YYYY') }} — {{ edu.safe.end.format('YYYY') }}

- {% }); %} + {{#each r.education.history}} +

{{ institution }} {{formatDate safe.start 'YYYY' }} — {{formatDate safe.end 'YYYY' }}

+ {{/each}}
-{% } %} +{{/if}} -{% if ( r.service && r.service.history && r.service.history.length ) { %} +{{#if r.service}}

Service


- {% r.service.history.forEach( function( vol, idx, ar ) { %} -

{{ vol.position }}, {{ filt.link(vol.organization, vol.url) }} {{ vol.safe.start.format('YYYY') }} — {{ vol.safe.end.format('YYYY') }}

-

{{ vol.summary }}

- {% if( vol.highlights ) { %} + {{#each r.service.history}} +

{{ position }}, + {{#if url}} + {{ organization }} + {{else}} + {{ organization }} + {{/if}} + {{formatDate safe.start 'YYYY' }} — {{formatDate safe.end 'YYYY' }}

+

{{ summary }}

+ {{#if highlights}} - {% } %} - {% }); %} + {{/if}} + {{/each}}
-{% } %} +{{/if}} -{% if( r.writing && r.writing.length ) { %} +{{#if r.writing}}

Writing


- {% r.writing.forEach( function( pub, idx, ar ) { %} -

{{ filt.link( pub.title, pub.url ) }}, {{ pub.publisher }} {{ pub.safe.date.format('YYYY') }}

- - {% if (pub.summary) { %}{{ pub.summary }}{% } %} - - {% }); %} + {{#each r.writing }} +

{{#if url}}{{ title }}{{else}}{{ title }}{{/if}}, + {{ publisher }} {{formatDate safe.date 'YYYY'}}

+ {{# if summary}}{{ summary }}{{/if}} + {{/each}}
-{% } %} +{{/if}} -{% if( r.recognition && r.recognition.length ) { %} +{{# if r.recognition}}

Awards


- {% r.recognition.forEach( function( award, idx, ar) { %} -

{{ award.title }}, {{ award.from }} {{ award.safe.date.format('YYYY') }}

- {{ award.summary }} - {% }); %} + {{#each r.recognition}} +

{{ title }}, {{ from }} {{formatDate safe.date 'YYYY' }}

+ {{ summary }} + {{/each}}
-{% } %} +{{/if}} diff --git a/themes/compact/src/compact-txt.txt b/themes/compact/src/compact-txt.txt index a33c4eb..df3991b 100644 --- a/themes/compact/src/compact-txt.txt +++ b/themes/compact/src/compact-txt.txt @@ -1,50 +1,90 @@ -{# +{{! compact/txt.txt A plain text resume template for FluentCV's "compact" theme. -#} +}} {{ r.name }} -{% if (r.contact.email) { %}Email: {{ r.contact.email }}{% } %} -{% if (r.contact.phone) { %}Tel: {{ r.contact.phone }}{% } %} -{% if (r.contact.website) { %}Web: {{ r.contact.website }}{% } %} +{{#if r.contact.email }}Email: {{{ r.contact.email }}}{{/if}} +{{#if r.contact.phone }}Tel: {{{ r.contact.phone }}}{{/if}} +{{#if r.contact.website }}Web: {{{ r.contact.website }}}{{/if}} +================================================================================ -*** +{{#if r.info.brief }}{{{ r.info.brief }}}{{/if}} -{% if ( r.info.brief && r.info.brief.length ) { %}{{ r.info.brief }}{% } %} +{{#if r.skills}} +SKILLS ------------------------------------------------------------------------- +{{#each r.skills.sets}} + - {{{ name }}}: {{#each this.skills}}{{{ this }}} {{/each}} +{{/each}} +{{/if}} -{% if ( r.skills && r.skills.length ) { %}SKILLS -{% r.skills.forEach( function( skill ) { %} - - {{ skill.name }}: {{ skill.level }} -{% }); } %} +{{#if r.employment}} +EMPLOYMENT --------------------------------------------------------------------- -{% if ( r.employment.history && r.employment.history.length ) { %}EMPLOYMENT -{% r.employment.history.forEach( function( proj, idx, ar) { %} -{{ proj.employer }} ({{ proj.safe.start.format('YYYY-MM') }} — {{ proj.safe.end.format('YYYY-MM') }}) -{{ proj.summary }} -{% if( proj.highlights ) { %}{% proj.highlights.forEach( function( high ) { %} - - {{ high }} -{% }); } }); } %} +{{#each r.employment.history }} + {{#compare @index 4 operator="<"}} +{{{ position }}}, {{{ employer }}} ({{formatDate safe.start 'YYYY-MM' }} -- {{formatDate safe.end 'YYYY-MM' }}) +{{{ summary }}} +{{#if highlights}} +{{#each highlights}} + - {{{ this }}} +{{/each}} +{{/if}} -{% if ( r.education && r.education.history ) { %}EDUCATION -{% r.education.history.forEach( function( edu, idx, ar) { %} -{{ edu.institution }} ({{ edu.safe.start.format('YYYY-MM') }} — {{ edu.safe.end.format('YYYY-MM') }}) -{{ edu.summary }} -{% if( edu.courses ) { %}{% edu.courses.forEach( function( course ) { %} - - {{ course }} -{% }); } }); } %} + {{/compare}} + {{#compare @index 4 operator=">="}} + {{#compare @index 4 operator="=="}} +Previously... +Prior to {{{ employer }}}, I worked on a range of projects for companies large and small. + {{/compare}} + - {{{ position }}}, {{{ employer }}} + {{/compare}} +{{/each}} +{{/if}} -{% if ( r.service && r.service.history ) { %}VOLUNTEER -{% r.service.history.forEach( function( srv, idx, ar) { %} -{{ srv.organization }} ({{ srv.safe.start.format('YYYY-MM') }} — {{ srv.safe.end.format('YYYY-MM') }}) -{{ srv.summary }} -{% if( srv.highlights ) { %}{% srv.highlights.forEach( function( high ) { %} - - {{ high }} -{% }); } }); } %} +{{#if r.education}} +EDUCATION ---------------------------------------------------------------------- -{% if ( r.writing && r.writing.length ) { %}WRITING -{% r.writing.forEach( function( wri, idx, ar) { %} -{{ wri.title }} ({{ wri.safe.date.format('YYYY-MM') }}) -{{ wri.summary }} -{% }); } %} +{{#each r.education.history}} +{{{ institution }}} ({{formatDate safe.start 'YYYY-MM' }} — {{formatDate safe.end 'YYYY-MM' }}) +{{#if summary }} +{{{ summary }}} +{{/if}} +{{#if courses}} +{{#each courses}} + - {{{ this }}}{{/each}}{{/if}} +{{/each}} +{{/if}} +{{#if r.writing}} +WRITING ------------------------------------------------------------------------ + +{{#each r.writing}} +{{{ title }}} ({{formatDate safe.date 'YYYY-MM' }}) +{{{ summary }}} +{{/each}} +{{/if}} + +{{#if r.service }} +SERVICE ------------------------------------------------------------------------ + +{{#each r.service.history}} +{{{ organization }}} ({{formatDate safe.start 'YYYY-MM' }} — {{formatDate safe.end 'YYYY-MM' }}) +{{{ summary }}} +{{#if highlights}} +{{#each highlights}} + - {{{ this }}} +{{/each}} +{{/if}} + +{{/each}} +{{/if}} +{{#if r.recognition}} +RECOGNITION -------------------------------------------------------------------- + +{{#each r.recognition}} +{{{ title }}}, {{{ from }}} ({{formatDate safe.date 'MMM YYYY' }}) +{{{ summary }}} +{{/each}} +{{/if}}