From 16e8bc28b16b4265fa9d511e4a1d934dcd366478 Mon Sep 17 00:00:00 2001 From: Rafael Bardini Date: Sun, 20 Jun 2021 16:23:55 +0200 Subject: [PATCH] feat(image): render image as profile picture --- partials/header.hbs | 3 +++ style.css | 7 +++++++ tap-snapshots/test/render.js.test.cjs | 8 ++++++++ test/render.js | 5 ++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/partials/header.hbs b/partials/header.hbs index 0b367a6..9c1556e 100644 --- a/partials/header.hbs +++ b/partials/header.hbs @@ -1,4 +1,7 @@
+ {{#image}} + + {{/image}}
{{#name}}

{{.}}

diff --git a/style.css b/style.css index 9c48181..8982ecd 100644 --- a/style.css +++ b/style.css @@ -161,6 +161,13 @@ section { grid-column: main; } +.masthead > img { + border-radius: 50%; + grid-column: side; + grid-row: span 2; + max-width: 100%; +} + article > * + *, blockquote > * + * { margin-top: 0.6em; diff --git a/tap-snapshots/test/render.js.test.cjs b/tap-snapshots/test/render.js.test.cjs index f997741..8683b2f 100644 --- a/tap-snapshots/test/render.js.test.cjs +++ b/tap-snapshots/test/render.js.test.cjs @@ -177,6 +177,13 @@ section { grid-column: main; } +.masthead > img { + border-radius: 50%; + grid-column: side; + grid-row: span 2; + max-width: 100%; +} + article > * + *, blockquote > * + * { margin-top: 0.6em; @@ -251,6 +258,7 @@ blockquote > * + * {
+

Richard Hendriks

Programmer

diff --git a/test/render.js b/test/render.js index deff04d..eff4de2 100644 --- a/test/render.js +++ b/test/render.js @@ -4,6 +4,9 @@ const { HtmlValidate } = require('html-validate') const { render } = require('..') const resume = require('resume-schema/sample.resume.json') +// Overwrite empty sample resume values +resume.basics.image = 'image.jpg' + test('renders a resume', t => { t.matchSnapshot(render(resume)) t.end() @@ -19,6 +22,6 @@ test('renders valid HTML', t => { results: [{ messages } = {}], } = htmlvalidate.validateString(render(resume)) - t.is(messages, undefined) + t.equal(messages, undefined) t.end() })