Skip to content

Commit

Permalink
feature: update resume and update packages (#29)
Browse files Browse the repository at this point in the history
* feature: update resume and update packages

* chore: updated resume
  • Loading branch information
vitormv committed Jul 28, 2021
1 parent f218bfe commit dd99057
Show file tree
Hide file tree
Showing 17 changed files with 1,716 additions and 1,499 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
extends: ['airbnb'],
plugins: ['react'],
globals: {
ga: 'readonly',
},
env: {
node: true,
browser: true,
Expand Down
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"zignd.html-css-class-completion",
"alanwalk.markdown-toc",
"clinyong.vscode-css-modules",
"redhat.vscode-yaml",
"mrmlnc.vscode-scss",
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Want to take a look at the code for yourself? Go ahead!
```bash
git clone git@github.com:vitormv/vmello-website.git vmello-website
cd vmello-website
npm run bootstrap
npm install && npm run start
```

Then open the `http://0.0.0.0:8000` on your favorite browser.
Then open the `http://0.0.0.0:8091` on your favorite browser.

## 🧐 What's inside?

Expand Down Expand Up @@ -54,9 +54,9 @@ Deploy is automated by using Github Actions + [Surge.sh](https://surge.sh/). It

## 💾 Update & download resume

After spending countless hours trying to create a greatly aligned resume in Google Docs, I finally decided to recreate it in html format (https://vmello.com/resume), and export it as pdf automatically. It heavily uses CSS media @print queries. The `.pdf` file is exported using Puppeteer.
After spending countless hours trying to create a greatly aligned resume in Google Docs, I finally decided to recreate it in html format (https://vmello.com/resume), and export it as `.pdf` using Puppeteer. It heavily uses CSS media @print queries.

```plain
```bash
npm run resume
```

Expand Down
18 changes: 16 additions & 2 deletions cli/export-pdf-resume.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import puppeteer from 'puppeteer';

const sourceUrl = 'http://localhost:9000/resume';
const sourceUrl = 'http://localhost:8092/resume';
const targetPdf = path.join('public', 'vitor-mello-resume.pdf');

async function exportResumeAsPdf() {
Expand All @@ -13,7 +13,21 @@ async function exportResumeAsPdf() {

await page.goto(sourceUrl, { waitUntil: 'networkidle0' });

await page.pdf({ format: 'A4', path: targetPdf, margin: { top: 0, right: 0, bottom: 0, left: 0 } });
// generate .pdf file
await page.pdf({
format: 'A4',
path: targetPdf,
displayHeaderFooter: true,
margin: { top: '12mm', right: 0, bottom: '12mm', left: 0 },
headerTemplate: ' ', // <--- empty spaces are needed XD
footerTemplate: `
<div style="width: 100%; font-style: italic; font-size: 9px; padding: 0; color: #bbb; font-family: 'Lora', serif; position: relative;">
<div style="position: absolute; right: 9mm; bottom: 5px;">
Vitor Mello; page <span class="pageNumber"></span> of <span class="totalPages"></span>.
</div>
</div>
`,
});

await page.close();
await browser.close();
Expand Down
Loading

1 comment on commit dd99057

@vercel
Copy link

@vercel vercel bot commented on dd99057 Jul 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.