Building CV with NodeJS, Grunt and Travis

Back in 2013 I realized that I don’t have a public CV and decided that I need one. I did not know what was the best way to get it, and I wanted it to be not a one-time creativity act, but a reusable solution.

A few ideas I had were:

  • The final artifact I wanted to get was a PDF document
  • I wanted to keep the content separate from design, so that new projects or position changes only require content update
  • I wanted my CV to automatically get rebuilt and published every time I push my changes to GitHub.

Those days NodeJS was a trendy piece of technology and that was the only reason I did not pick something else. The solution is a Grunt build script that utilizes a few plugins to generate the CV and publish it to GitHub Pages.

I use grunt-swig-it to generate a CV HTML page based on Swig template and a plain JSON file with CV data. Here’s a piece of Swig template:

1
2
3
4
5
<body>
<div class="personal">
<h1 class="name">{{ person.name }}</h1>
<p class="position">{{ person.position }}</p>
...

And here’s a piece of JSON with CV data:

1
2
3
4
5
{
"person": {
"name": "Andrey Agibalov",
"position": "Team Leader / Software Architect",
...

Together they make a CV HTML page:

I then use grunt-html-pdf to convert this HTML page to PDF:

As soon as both documents are ready, grunt-gh-pages plugin publishes them to GitHub Pages (here’s the HTML and here’s the PDF).

I have Travis CI configured to run the build and publish new version of my CV every time I push changes to the repository.

Here is the repository.