This commit is contained in:
Rafael Bardini 2018-09-23 20:28:05 +02:00
commit f203660e46
8 changed files with 832 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules/
npm-debug.log

21
LICENSE Normal file
View File

@ -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.

17
README.md Normal file
View File

@ -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).

32
index.js Normal file
View File

@ -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, "</p><p>");
});

72
package-lock.json generated Normal file
View File

@ -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="
}
}
}

18
package.json Normal file
View File

@ -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"
}
}

494
resume.template Normal file
View File

@ -0,0 +1,494 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimal-ui">
<title>{{#resume.basics}}{{name}}{{/resume.basics}}</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/2.0.2/octicons.min.css">
<style type="text/css">
{{{css}}}
</style>
</head>
<body>
<header id="header">
<div class="container">
<div class="row">
<div class="col-sm-9 col-sm-push-3">
{{#resume.basics}}
{{#name}}
<h1>
{{.}}
</h1>
{{/name}}
{{#label}}
<h2>
{{.}}
</h2>
{{/label}}
{{/resume.basics}}
</div>
</div>
</div>
</header>
<div id="content" class="container">
{{#resume.basics}}
<section id="contact" class="row">
<aside class="col-sm-3">
<h3>Contact</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#email}}
<div class="col-sm-6">
<strong>Email</strong>
<div class="email">
<a href="mailto:{{.}}">{{.}}</a>
</div>
</div>
{{/email}}
{{#phone}}
<div class="col-sm-6">
<strong>Phone</strong>
<div class="phone">{{.}}</div>
</div>
{{/phone}}
{{#url}}
<div class="col-sm-6">
<strong>Website</strong>
<div class="website">
<a href="{{.}}">{{.}}</a>
</div>
</div>
{{/url}}
</div>
</div>
</section>
{{#summary}}
<section id="about" class="row">
<aside class="col-sm-3">
<h3>About</h3>
</aside>
<div class="col-sm-9">
<p>{{.}}</p>
</div>
</section>
{{/summary}}
{{#if profiles.length}}
<section id="profiles" class="row">
<aside class="col-sm-3">
<h3>Profiles</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#profiles}}
<div class="col-sm-6">
{{#network}}
<strong class="network">
{{.}}
</strong>
{{/network}}
{{#if username}}
<div class="username">
{{#if url}}
<div class="url">
<a href="{{url}}">{{username}}</a>
</div>
{{else}}
{{username}}
{{/if}}
</div>
{{else}}
{{#if url}}
<div class="url">
<a href="{{url}}">{{url}}</a>
</div>
{{/if}}
{{/if}}
</div>
{{/profiles}}
</div>
</div>
</section>
{{/if}}
{{/resume.basics}}
{{#if resume.work.length}}
<section id="work" class="row">
<aside class="col-sm-3">
<h3>Work</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.work}}
<div class="col-sm-12">
<h4 class="strike-through">
<span>{{name}}</span>
<span class="date">
{{formatDate startDate}} —
{{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}}
</span>
</h4>
{{#url}}
<div class="website pull-right">
<a href="{{.}}">{{.}}</a>
</div>
{{/url}}
{{#position}}
<div class="position">
{{.}}
</div>
{{/position}}
{{#summary}}
<div class="summary">
<p>{{.}}</p>
</div>
{{/summary}}
{{#if highlights.length}}
<h4>Highlights</h4>
<ul class="highlights">
{{#highlights}}
<li class="bullet">{{.}}</li>
{{/highlights}}
</ul>
{{/if}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.volunteer.length}}
<section id="volunteer" class="row">
<aside class="col-sm-3">
<h3>Volunteer</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.volunteer}}
<div class="col-sm-12">
<h4 class="strike-through">
<span>{{organization}}</span>
<span class="date">
{{formatDate startDate}} —
{{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}}
</span>
</h4>
{{#url}}
<div class="website pull-right">
<a href="{{.}}">{{.}}</a>
</div>
{{/url}}
{{#position}}
<div class="position">
{{.}}
</div>
{{/position}}
{{#summary}}
<div class="summary">
<p>{{.}}</p>
</div>
{{/summary}}
{{#if highlights.length}}
<h4>Highlights</h4>
<ul class="highlights">
{{#highlights}}
<li class="bullet">{{.}}</li>
{{/highlights}}
</ul>
{{/if}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.education.length}}
<section id="education" class="row">
<aside class="col-sm-3">
<h3>Education</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.education}}
<div class="col-sm-12">
<h4 class="strike-through">
<span>{{institution}}</span>
<span class="date">
{{formatDate startDate}} —
{{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}}
</span>
</h4>
{{#url}}
<div class="website pull-right">
<a href="{{.}}">{{.}}</a>
</div>
{{/url}}
{{#area}}
<div class="area">
{{.}}
</div>
{{/area}}
{{#studyType}}
<div class="studyType">
{{.}}
</div>
{{/studyType}}
{{#if courses.length}}
<h4>Courses</h4>
<ul class="courses">
{{#courses}}
<li>{{.}}</li>
{{/courses}}
</ul>
{{/if}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.projects.length}}
<section id="projects" class="row">
<aside class="col-sm-3">
<h3>Projects</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.projects}}
<div class="col-sm-12">
<h4 class="strike-through">
<span>{{name}}</span>
<span class="date">
{{formatDate startDate}} —
{{#if endDate}}{{formatDate endDate}}{{else}}Present{{/if}}
</span>
</h4>
{{#url}}
<div class="website pull-right">
<a href="{{.}}">{{.}}</a>
</div>
{{/url}}
<div class="roles">
<strong>{{join roles}}</strong>
{{#entity}}
<em>at</em>
<strong>{{.}}</strong>
{{/entity}}
</div>
{{#description}}
<div class="description">
<p>{{.}}</p>
</div>
{{/description}}
{{#if highlights.length}}
<h4>Highlights</h4>
<ul class="highlights">
{{#highlights}}
<li class="bullet">{{.}}</li>
{{/highlights}}
</ul>
{{/if}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.awards.length}}
<section id="awards" class="row">
<aside class="col-sm-3">
<h3>Awards</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.awards}}
<div class="col-sm-12">
<h4 class="strike-through">
<span>{{title}}</span>
</h4>
{{#date}}
<div class="date pull-right">
<em>Awarded</em>
{{formatDate .}}
</div>
{{/date}}
{{#awarder}}
<div class="awarder">
<em>by</em>
<strong>{{.}}</strong>
</div>
{{/awarder}}
{{#summary}}
<div class="summary">
{{.}}
</div>
{{/summary}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.publications.length}}
<section id="publications" class="row">
<aside class="col-sm-3">
<h3>Publications</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.publications}}
<div class="col-sm-12">
<h4 class="strike-through">
<span>{{name}}</span>
<span class="date">
{{releaseDate}}
</span>
</h4>
{{#url}}
<div class="website pull-right">
<a href="{{.}}">{{.}}</a>
</div>
{{/url}}
{{#publisher}}
<div class="publisher">
<em>Published by</em>
<strong>{{.}}</strong>
</div>
{{/publisher}}
{{#summary}}
<div class="summary">
<p>{{.}}</p>
</div>
{{/summary}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.skills.length}}
<section id="skills" class="row">
<aside class="col-sm-3">
<h3>Skills</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.skills}}
<div class="col-sm-6">
{{#name}}
<div class="name">
<h4>{{.}}</h4>
</div>
{{/name}}
{{#if keywords.length}}
<ul class="keywords">
{{#keywords}}
<li>{{.}}</li>
{{/keywords}}
</ul>
{{/if}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.languages.length}}
<section id="languages" class="row">
<aside class="col-sm-3">
<h3>Languages</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.languages}}
<div class="col-sm-6">
{{#language}}
<div class="language">
<strong>{{.}}</strong>
</div>
{{/language}}
{{#fluency}}
<div class="fluency">
{{.}}
</div>
{{/fluency}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.interests.length}}
<section id="interests" class="row">
<aside class="col-sm-3">
<h3>Interests</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.interests}}
<div class="col-sm-6">
{{#name}}
<div class="name">
<h4>{{.}}</h4>
</div>
{{/name}}
{{#if keywords.length}}
<ul class="keywords">
{{#keywords}}
<li>{{.}}</li>
{{/keywords}}
</ul>
{{/if}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
{{#if resume.references.length}}
<section id="references" class="row">
<aside class="col-sm-3">
<h3>References</h3>
</aside>
<div class="col-sm-9">
<div class="row">
{{#each resume.references}}
<div class="col-sm-12">
{{#if reference}}
<blockquote class="reference">
<p>{{reference}}</p>
{{#name}}
<p class="name">
<strong>— {{.}}</strong>
</p>
{{/name}}
</blockquote>
{{/if}}
</div>
{{/each}}
</div>
</div>
</section>
{{/if}}
</div>
</body>
</html>

176
style.css Normal file
View File

@ -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;
}
}