will this work

This commit is contained in:
thomasdavis 2014-07-08 17:45:52 +10:00
parent 4f1bd93c59
commit b5175e395a
5 changed files with 385 additions and 2 deletions

165
container.template Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,39 @@
var fs = require('fs');
var gravatar = require('gravatar');
var lodash = require('lodash');
function render(resumeObject) { function render(resumeObject) {
return JSON.stringify(resumeObject);
_.each(resumeObject.work, function(w){
w.startDateYear = w.startDate.substr(0,4);
if(w.endDate) {
w.endDateYear = w.endDate.substr(0,4);
} else {
w.endDateYear = 'Present'
}
});
_.each(resumeObject.education, function(e){
e.startDateYear = e.startDate.substr(0,4);
if(e.endDate) {
e.endDateYear = e.endDate.substr(0,4);
} else {
e.endDateYear = 'Present'
}
});
if(resumeObject.bio && resumeObject.bio.email && resumeObject.bio.email.personal) {
resumeObject.bio.gravatar = gravatar.url(resumeObject.bio.email.personal, {
s: '100',
r: 'pg',
d: 'mm'
});
}
var theme = fs.readFileSync('resume.template', 'utf8');
var resumeHTML = Mustache.render(theme, resumeObject);
return JSON.stringify(resumeHTML);
}; };
module.exports = { module.exports = {

View File

@ -1,6 +1,6 @@
{ {
"name": "jsonresume-theme-modern", "name": "jsonresume-theme-modern",
"version": "0.0.5", "version": "0.0.6",
"description": "jsonresume-theme-modern =======================", "description": "jsonresume-theme-modern =======================",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -17,6 +17,8 @@
}, },
"homepage": "https://github.com/jsonresume/jsonresume-theme-modern", "homepage": "https://github.com/jsonresume/jsonresume-theme-modern",
"dependencies": { "dependencies": {
"gravatar": "^1.0.6",
"lodash": "^2.4.1",
"tarball-extract": "0.0.3" "tarball-extract": "0.0.3"
} }
} }

18
resume.css Normal file

File diff suppressed because one or more lines are too long

165
resume.template Normal file

File diff suppressed because one or more lines are too long