commit f203660e46d2679161744fc78ac561de3b1533cc Author: Rafael Bardini Date: Sun Sep 23 20:28:05 2018 +0200 0.1.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ca9571 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2937f87 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Rafael Bardini + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a64230e --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +jsonresume-theme-even +===================== + +[![npm package version](https://img.shields.io/npm/v/jsonresume-theme-even.svg)](https://www.npmjs.com/package/jsonresume-theme-even) +[![Dependency status](https://img.shields.io/david/rbardini/jsonresume-theme-even.svg)](https://david-dm.org/rbardini/jsonresume-theme-even) + +A flat theme for [JSON Resume](https://jsonresume.org/), compatible with the bleeding edge [resume schema](https://github.com/jsonresume/resume-schema/tree/v1.0.0). + +Based on [jsonresume-theme-flat](https://github.com/erming/jsonresume-theme-flat). + +## Installation + + $ npm install jsonresume-theme-even + +## License + +Licensed under the [MIT License](https://opensource.org/licenses/MIT). diff --git a/index.js b/index.js new file mode 100644 index 0000000..a946279 --- /dev/null +++ b/index.js @@ -0,0 +1,32 @@ +var fs = require("fs"); +var Handlebars = require("handlebars"); + +module.exports = { + render: render +}; + +function render(resume) { + var css = fs.readFileSync(__dirname + "/style.css", "utf-8"); + var template = fs.readFileSync(__dirname + "/resume.template", "utf-8"); + return Handlebars.compile(template)({ + css: css, + resume: resume + }); +} + +Handlebars.registerHelper("formatDate", function(dateString) { + const date = new Date(dateString); + return date.toLocaleDateString("en", { + month: "short", + year: "numeric" + }); +}); + +Handlebars.registerHelper("join", function(arr, separator) { + separator = typeof separator === "string" ? separator : ", "; + return arr.join(separator); +}); + +Handlebars.registerHelper("nl2br", function(value) { + return (value || "").replace(/\n/g, "

"); +}); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..10a76dc --- /dev/null +++ b/package-lock.json @@ -0,0 +1,72 @@ +{ + "name": "jsonresume-theme-even", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "requires": { + "lodash": "^4.17.10" + } + }, + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "optional": true + }, + "handlebars": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", + "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "requires": { + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "minimist": { + "version": "0.0.10", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "uglify-js": { + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "optional": true, + "requires": { + "commander": "~2.17.1", + "source-map": "~0.6.1" + } + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1a4277f --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "jsonresume-theme-even", + "version": "0.1.0", + "description": "A flat theme for JSON Resume, compatible with the bleeding edge resume schema", + "author": "Rafael Bardini", + "homepage": "https://github.com/rbardini/jsonresume-theme-even", + "repository": { + "type": "git", + "url": "https://github.com/rbardini/jsonresume-theme-even" + }, + "bugs": { + "url": "https://github.com/rbardini/jsonresume-theme-even/issues" + }, + "license": "MIT", + "dependencies": { + "handlebars": "4.0.12" + } +} diff --git a/resume.template b/resume.template new file mode 100644 index 0000000..5242cf7 --- /dev/null +++ b/resume.template @@ -0,0 +1,494 @@ + + + + + + + + {{#resume.basics}}{{name}}{{/resume.basics}} + + + + + + + + + +

+
+ + {{#resume.basics}} +
+ +
+
+ {{#email}} +
+ Email + +
+ {{/email}} + {{#phone}} +
+ Phone +
{{.}}
+
+ {{/phone}} + {{#url}} +
+ Website +
+ {{.}} +
+
+ {{/url}} +
+
+
+ {{#summary}} +
+ +
+

{{.}}

+
+
+ {{/summary}} + {{#if profiles.length}} +
+ +
+
+ {{#profiles}} +
+ {{#network}} + + {{.}} + + {{/network}} + {{#if username}} +
+ {{#if url}} + + {{else}} + {{username}} + {{/if}} +
+ {{else}} + {{#if url}} +
+ {{url}} +
+ {{/if}} + {{/if}} +
+ {{/profiles}} +
+
+
+ {{/if}} + {{/resume.basics}} + + {{#if resume.work.length}} +
+ +
+
+ {{#each resume.work}} +
+

+ {{name}} + + {{formatDate startDate}} — + {{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}} + +

+ {{#url}} +
+ {{.}} +
+ {{/url}} + {{#position}} +
+ {{.}} +
+ {{/position}} + {{#summary}} +
+

{{.}}

+
+ {{/summary}} + {{#if highlights.length}} +

Highlights

+
    + {{#highlights}} +
  • {{.}}
  • + {{/highlights}} +
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.volunteer.length}} +
+ +
+
+ {{#each resume.volunteer}} +
+

+ {{organization}} + + {{formatDate startDate}} — + {{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}} + +

+ {{#url}} +
+ {{.}} +
+ {{/url}} + {{#position}} +
+ {{.}} +
+ {{/position}} + {{#summary}} +
+

{{.}}

+
+ {{/summary}} + {{#if highlights.length}} +

Highlights

+
    + {{#highlights}} +
  • {{.}}
  • + {{/highlights}} +
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.education.length}} +
+ +
+
+ {{#each resume.education}} +
+

+ {{institution}} + + {{formatDate startDate}} — + {{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}} + +

+ {{#url}} +
+ {{.}} +
+ {{/url}} + {{#area}} +
+ {{.}} +
+ {{/area}} + {{#studyType}} +
+ {{.}} +
+ {{/studyType}} + {{#if courses.length}} +

Courses

+
    + {{#courses}} +
  • {{.}}
  • + {{/courses}} +
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.projects.length}} +
+ +
+
+ {{#each resume.projects}} +
+

+ {{name}} + + {{formatDate startDate}} — + {{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}} + +

+ {{#url}} +
+ {{.}} +
+ {{/url}} +
+ {{join roles}} + {{#entity}} + at + {{.}} + {{/entity}} +
+ {{#description}} +
+

{{.}}

+
+ {{/description}} + {{#if highlights.length}} +

Highlights

+
    + {{#highlights}} +
  • {{.}}
  • + {{/highlights}} +
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.awards.length}} +
+ +
+
+ {{#each resume.awards}} +
+

+ {{title}} +

+ {{#date}} +
+ Awarded + {{formatDate .}} +
+ {{/date}} + {{#awarder}} +
+ by + {{.}} +
+ {{/awarder}} + {{#summary}} +
+ {{.}} +
+ {{/summary}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.publications.length}} +
+ +
+
+ {{#each resume.publications}} +
+

+ {{name}} + + {{releaseDate}} + +

+ {{#url}} +
+ {{.}} +
+ {{/url}} + {{#publisher}} +
+ Published by + {{.}} +
+ {{/publisher}} + {{#summary}} +
+

{{.}}

+
+ {{/summary}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.skills.length}} +
+ +
+
+ {{#each resume.skills}} +
+ {{#name}} +
+

{{.}}

+
+ {{/name}} + {{#if keywords.length}} +
    + {{#keywords}} +
  • {{.}}
  • + {{/keywords}} +
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.languages.length}} +
+ +
+
+ {{#each resume.languages}} +
+ {{#language}} +
+ {{.}} +
+ {{/language}} + {{#fluency}} +
+ {{.}} +
+ {{/fluency}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.interests.length}} +
+ +
+
+ {{#each resume.interests}} +
+ {{#name}} +
+

{{.}}

+
+ {{/name}} + {{#if keywords.length}} +
    + {{#keywords}} +
  • {{.}}
  • + {{/keywords}} +
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/if}} + + {{#if resume.references.length}} +
+ +
+
+ {{#each resume.references}} +
+ {{#if reference}} +
+

{{reference}}

+ {{#name}} +

+ — {{.}} +

+ {{/name}} +
+ {{/if}} +
+ {{/each}} +
+
+
+ {{/if}} + +
+ + + diff --git a/style.css b/style.css new file mode 100644 index 0000000..243c195 --- /dev/null +++ b/style.css @@ -0,0 +1,176 @@ +@import url( + https://fonts.googleapis.com/css?family=Lato:400,700 +); +body { + background: #fff; + font-family: Lato, sans-serif; + margin: 0 0 80px; +} +a { + color: #2ecc71; +} +a:focus, +a:hover { + color: #f1c40f; + text-decoration: none; +} +p { + line-height: 1.5; + margin: 0; +} +p + p { + margin-top: 10px; +} +h1, +h2, +h3, +h4 { + margin-top: 0 +} +section { + margin-top: 30px; +} +li { + line-height: 1.8; + list-style: none; +} +li:before { + content: "\f052"; + float: left; + font: 13px Octicons; + margin-top: 6px; + margin-left: -20px; + opacity: .1; + position: absolute; +} +blockquote { + border-left: 5px solid #e7e9ec; + font-size: 14px; +} +em { + color: #95a5a6; + font-weight: normal; + font-style: normal; +} +h4 span:first-child { + color: #000; + font-weight: bold; +} +.container { + max-width: 750px; + padding: 0 30px; +} +.col-sm-6 { + margin-bottom: 10px; +} +.col-sm-12 h4 { + margin-top: 12px; +} +.col-sm-12 + .col-sm-12 { + margin-top: 30px; +} +#header { + background: #f4f6f6; + padding: 50px 0; + margin-bottom: 30px; +} +#header h2 { + color: #95a5a6; + font-size: 24px; +} +#content h3 { + color: #f1c40f; + font-size: 26px; + margin-top: -4px; +} +#content aside { + text-align: right; + padding-right: 30px; +} +#profiles .network { + text-transform: capitalize; +} +#work .position, +#volunteer .position { + font-weight: bold; + margin-bottom: 8px; +} +#education .area { + font-weight: bold; +} +#education .area:before { + content: "\f0d7"; + font: 16px Octicons; + margin-right: 6px; +} +#education .studyType { + margin-left: 25px; +} +#awards .summary, +#publications .summary, +#projects .description { + margin-top: 8px; +} +#publications .website a:before { + content: attr(href); +} + +@media (min-width: 480px) { + .strike-through { + border-top: 1px solid #f4f6f6; + height: 20px; + margin-top: 12px; + margin-bottom: -2px; + position: relative; + } + .strike-through span, + .strike-through a { + background: #fff; + position: absolute; + } + .strike-through span:first-child { + padding-right: 20px; + margin-top: -12px; + } + .strike-through span + span { + font-size: 14px; + margin-top: -10px; + padding-left: 20px; + right: 0; + } +} +@media (max-width: 768px) { + .col-sm-6:last-child { + margin-bottom: 0px; + } + #content aside { + margin-bottom: 20px; + padding-right: 0; + text-align: left; + } + #publications .website a:before { + content: "View publication"; + } +} +@media (max-width: 480px) { + h1 { + font-size: 26px; + } + .date { + font-size: 14px; + margin-bottom: 5px; + } + .strike-through span:first-child { + margin-bottom: 7px; + } + .strike-through span { + display: block; + } + #header { + margin-bottom: 10px; + padding: 40px 0; + } + #actions { + display: none; + } +}