Skip to content

Commit

Permalink
make a better print version
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoRPS committed Dec 13, 2016
1 parent 1f07e1b commit a7d8dc7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ var Moment = require('moment');
function render(resume) {
var css = fs.readFileSync(__dirname + "/style.css", "utf-8");
var template = fs.readFileSync(__dirname + "/resume.template", "utf-8");
var print = fs.readFileSync(__dirname + "/print.css", "utf-8");

return Handlebars.compile(template)({
css: css,
resume: resume
print: print,
resume: resume,
});
};

Expand All @@ -28,4 +30,4 @@ Handlebars.registerHelper('toLowerCase', function(str) {

module.exports = {
render: render
}
}
5 changes: 5 additions & 0 deletions print.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@media print{
body > div > div:nth-child(7) .row:nth-of-type(n+11) {
display: none;
}
}
8 changes: 7 additions & 1 deletion resume.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<style>
{{{css}}}
{{{print}}}
</style>
</head>
<body>
Expand All @@ -26,14 +27,18 @@
<ul class="pull-right">
<li>{{email}}</li>
<li>{{phone}}</li>
{{#if profiles.length}}
<li>
{{#each profiles}}
<i class="fa fa-{{toLowerCase network}}"></i> {{username}}
{{/each}}
</li>
{{/if}}
</ul>
</div>
</div>

{{#resume.basics}}
<hr style="margin-top: 0;" />

<!-- Profile/summary -->
Expand All @@ -47,6 +52,7 @@
{{/resume.basics}}
</div>
<hr />
{{/resume.basics}}

<!-- Skills -->
<div class="row">
Expand Down Expand Up @@ -125,4 +131,4 @@

</div> <!-- /end container-fluid -->
</body>
</html>
</html>

0 comments on commit a7d8dc7

Please sign in to comment.