diff --git a/.gitignore b/.gitignore index e82a8b6..3053511 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ resume.html resume.pdf resume.json .DS_Store +.log diff --git a/index.js b/index.js index e87e041..6daa209 100644 --- a/index.js +++ b/index.js @@ -5,26 +5,71 @@ var Handlebars = require("handlebars"); function render(resume) { var css = fs.readFileSync(__dirname + "/style.css", "utf-8"); var tpl = fs.readFileSync(__dirname + "/resume.hbs", "utf-8"); + var partialsDir = path.join(__dirname, 'partials'); var filenames = fs.readdirSync(partialsDir); - filenames.forEach(function (filename) { var matches = /^([^.]+).hbs$/.exec(filename); if (!matches) { return; } var name = matches[1]; - var filepath = path.join(partialsDir, filename) + var filepath = path.join(partialsDir, filename); var template = fs.readFileSync(filepath, 'utf8'); - Handlebars.registerPartial(name, template); }); + + Handlebars.registerHelper('icon', iconHtml); + Handlebars.registerHelper('year-month', shortenDateYearMonth); + return Handlebars.compile(tpl)({ css: css, resume: resume }); } +function iconHtml(iconName) { + let classes = ''; + switch (iconName) { + case 'GitHub': + return fontAwesomeHtml("fa-brands fa-github"); + case 'Mastodon': + return fontAwesomeHtml("fa-brands fa-mastodon"); + case 'Education': + return fontAwesomeHtml("fa-solid fa-graduation-cap"); + case 'Hammer': + return fontAwesomeHtml("fa-solid fa-hammer"); + case 'Language': + return fontAwesomeHtml("fa-solid fa-language"); + case 'Lightbulb': + return fontAwesomeHtml("fa-solid fa-lightbulb"); + case 'Paragraph': + return fontAwesomeHtml("fa-solid fa-paragraph"); + case 'Briefcase': + return fontAwesomeHtml("fa-solid fa-briefcase"); + case 'English': + return "🇬🇧"; + case "German": + return "🇩🇪"; + case "French": + return "🇫🇷"; + default: + console.warn("Could not fine icon: ", iconName); + return fontAwesomeHtml('fa-solid fa-file'); + } +} + +function fontAwesomeHtml(classes) { + return new Handlebars.SafeString(``); +} + + + + +function shortenDateYearMonth(date) { + return date.substring(0, 7); +} + module.exports = { render: render -}; \ No newline at end of file +}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3e33c1b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,111 @@ +{ + "name": "jsonresume-theme-boilerplate", + "version": "0.1.2", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "jsonresume-theme-boilerplate", + "version": "0.1.2", + "license": "MIT", + "dependencies": { + "handlebars": "^4.7.7" + } + }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uglify-js": { + "version": "3.16.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.2.tgz", + "integrity": "sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + } + }, + "dependencies": { + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "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.16.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.2.tgz", + "integrity": "sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==", + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + } + } +} diff --git a/package.json b/package.json index c1b3404..21a4626 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { - "name": "jsonresume-theme-boilerplate", - "version": "0.1.2", - "description": "Boilerplate theme for JSON Resume", - "author": "Mattias Erming", + "name": "jsonresume-theme-kindrobot", + "version": "0.1.0", + "description": "kindrobot's theme for JSON Resume", + "author": "Stef Dunlap", "repository": { "type": "git", - "url": "https://github.com/erming/jsonresume-theme-boilerplate" + "url": "https://github.com/motevets/jsonresume-theme-kindrobot" }, "license": "MIT", "dependencies": { - "handlebars": "^2.0.0-alpha.4" + "handlebars": "^4.7.7" } } diff --git a/partials/basics.hbs b/partials/basics.hbs index 38b4afa..5d276e4 100644 --- a/partials/basics.hbs +++ b/partials/basics.hbs @@ -11,80 +11,57 @@ {{/if}} {{#if email}}
- Email {{email}}
{{/if}} {{#if phone}}
- Phone {{phone}}
{{/if}} - {{#if summary}} -
-

{{summary}}

-
- {{/if}} {{#location}} -

Location

{{#if address}} -
- Address - {{address}} -
- {{/if}} - {{#if postalCode}} -
- Postal code - {{postalCode}} -
+ {{address}}
{{/if}} {{#if city}} -
- City - {{city}} -
- {{/if}} - {{#if countryCode}} -
- Country code - {{countryCode}} -
- {{/if}} + {{city}}, + {{/if}} {{#if region}} -
- Region - {{region}} -
- {{/if}} + {{region}}, + {{/if}} + {{#if postalCode}} + {{postalCode}}
+ {{/if}} + {{#if countryCode}} + {{countryCode}} + {{/if}}
{{/location}} {{#if profiles.length}} -

Profiles

+
{{/if}} -{{/resume.basics}} \ No newline at end of file +{{/resume.basics}} diff --git a/partials/education.hbs b/partials/education.hbs index 2618f9f..010fa70 100644 --- a/partials/education.hbs +++ b/partials/education.hbs @@ -1,39 +1,39 @@ {{#if resume.education.length}}
-

Education

+

{{icon "Education"}} Education

{{#each resume.education}}
-
- {{#if startDate}} - - {{startDate}} - - {{/if}} - {{#if endDate}} - - - {{endDate}} - - {{else}} - - - Present - - {{/if}} -
{{#if institution}}
{{institution}}
{{/if}} +
+ {{#if startDate}} + + {{year-month startDate}} + + {{/if}} + {{#if endDate}} + + - {{year-month endDate}} + + {{else}} + + - Present + + {{/if}} +
+ {{#if studyType}} +
+ {{studyType}} +
+ {{/if}} {{#if area}}
{{area}}
{{/if}} - {{#if studyType}} -
- {{studyType}} -
- {{/if}} {{#if gpa}}
GPA: {{gpa}} @@ -49,4 +49,4 @@
{{/each}}
-{{/if}} \ No newline at end of file +{{/if}} diff --git a/partials/interests.hbs b/partials/interests.hbs index bea8b36..a2ae15d 100644 --- a/partials/interests.hbs +++ b/partials/interests.hbs @@ -1,6 +1,6 @@ {{#if resume.interests.length}}
-

Interests

+

{{icon "Lightbulb"}} Interests

{{#each resume.interests}}
{{#if name}} @@ -18,4 +18,4 @@
{{/each}}
-{{/if}} \ No newline at end of file +{{/if}} diff --git a/partials/languages.hbs b/partials/languages.hbs index cab7cbd..bdba018 100644 --- a/partials/languages.hbs +++ b/partials/languages.hbs @@ -1,11 +1,13 @@ {{#if resume.languages.length}}
-

Languages

+

{{icon "Language"}} Languages

+
+
+ {{/each}} + +
-{{/if}} \ No newline at end of file +{{/if}} diff --git a/partials/skills.hbs b/partials/skills.hbs index 58e25e1..cec904a 100644 --- a/partials/skills.hbs +++ b/partials/skills.hbs @@ -1,6 +1,6 @@ {{#if resume.skills.length}}
-

Skills

+

{{icon "Hammer"}} Skills

{{#each resume.skills}}
{{#if name}} @@ -23,4 +23,4 @@
{{/each}}
-{{/if}} \ No newline at end of file +{{/if}} diff --git a/partials/summary.hbs b/partials/summary.hbs new file mode 100644 index 0000000..4150036 --- /dev/null +++ b/partials/summary.hbs @@ -0,0 +1,10 @@ +{{#resume.basics}} +{{#if summary}} +
+

{{icon "Paragraph"}} Summary

+
+

{{summary}}

+
+
+{{/if}} +{{/resume.basics}} diff --git a/partials/work.hbs b/partials/work.hbs index e8d8246..c5b1ab1 100644 --- a/partials/work.hbs +++ b/partials/work.hbs @@ -1,22 +1,22 @@ {{#if resume.work.length}}
-

Work

+

{{icon "Briefcase"}} Work

{{#each resume.work}}
- {{#if company}} + {{#if name}}

- {{company}} + {{name}}

{{/if}}
{{#if startDate}} - {{startDate}} + {{year-month startDate}} {{/if}} {{#if endDate}} - - {{endDate}} + - {{year-month endDate}} {{else}} @@ -49,4 +49,4 @@
{{/each}}
-{{/if}} \ No newline at end of file +{{/if}} diff --git a/resume.hbs b/resume.hbs index 7d6fe43..66023ff 100644 --- a/resume.hbs +++ b/resume.hbs @@ -1,29 +1,35 @@ - - - - - - {{#resume.basics}}{{name}}{{/resume.basics}} + + + + + + {{#resume.basics}}{{name}}{{/resume.basics}} - - - - - -
- {{> basics }} - {{> work }} - {{> volunteer }} - {{> education }} - {{> awards }} - {{> publications }} - {{> skills }} - {{> languages }} - {{> interests }} - {{> references }} - + + + + + +
+ +
+ {{> summary }} + {{> work }} + {{> volunteer }} + {{> publications }} + {{> awards }} + {{> references }} +
+
+ diff --git a/style.css b/style.css index 1031fba..811014d 100644 --- a/style.css +++ b/style.css @@ -1,54 +1,132 @@ -body { - background: #fff; - font: 15px Arial, Helvetica, sans-serif; - line-height: 1.4; - margin: 50px 0; - margin-bottom: 100px; +:root { + --sidebar-bg: #222; } -em { - color: #999; +/* BEGIN RESET CSS + http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +/* END RESET CSS */ +body { + background-image: linear-gradient(to right, var(--sidebar-bg) 50%, #fff 50%); + font-family: Arial, Helvetica, sans-serif; + line-height: 1.3; } p { - line-height: 1.4; } -ul { - margin-bottom: 0; +section, div.item { + padding-top: 1em; + break-inside: avoid; } -section { - margin-bottom: 2em; -} -blockquote { - margin: 0; - margin-bottom: 1em; -} -.item { - margin-bottom: 1em; +section#work{ + break-inside: auto; } #resume { - margin: 0 auto; - max-width: 480px; - padding: 0 20px; + margin: 0 auto; + max-width: 8.5in; + display: flex; + padding: 20px 0; } -#basics { - margin-bottom: -10px; +#sidebar, #chronology { + padding: 0 1em; } -#basics h3 { - margin-top: 1.5em; +#sidebar { + background-color: var(--sidebar-bg); + color: #fff; + font-size: 0.9em; } -#basics .contact strong, -#location strong { - clear: both; - float: left; - line-height: 1.3; - width: 120px; +#sidebar a { + color: #fff; } -#profiles, -#skills { - overflow: hidden; +#profiles li { + margin-bottom: 0.5em; } -#profiles .item, -#skills .item { - float: left; - width: 50%; +#profiles .network { + font-weight: bold; +} +#chronology { + background-color: #fff; + padding-left: 10px; +} +h1 { + font-size: 2.9em; + white-space: nowrap; +} +h2 { + font-size: 1.5em; +} +h3 { + font-size: 1.2em; +} +.institution { + font-weight: bold; +} +.date { + font-style: italic; +} +#skills .name, #interests .name { + font-weight: bold; +} +#skills .level { + font-style: italic; +} +.keywords li { + display: inline-block; + border: #fff solid 1px; + padding: 0 2px; + border-radius: 5px; + margin-top: 5px; +} +#languages .language { + font-weight: bold; +} +#languages .fluency { + font-style: italic; +} +#work .position { + font-weight: bold; } -