fix(meta): only add description if summary exists

Closes #10
This commit is contained in:
Rafael Bardini 2021-03-09 12:40:08 +01:00
parent b5baa3f208
commit 2edf556a7e
3 changed files with 7 additions and 4 deletions

2
partials/meta.hbs Normal file
View File

@ -0,0 +1,2 @@
{{#name}}<title>{{.}}</title>{{/name}}
{{#summary}}<meta name="description" content="{{stripTags (markdown .)}}">{{/summary}}

View File

@ -2,8 +2,9 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{resume.basics.name}}</title> {{#resume.basics}}
<meta name="description" content="{{stripTags (markdown resume.basics.summary)}}"> {{> meta}}
{{/resume.basics}}
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap">
<style>{{{css}}}</style> <style>{{{css}}}</style>

View File

@ -10,8 +10,8 @@ exports[`test/render.js TAP renders a resume > must match snapshot 1`] = `
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Richard Hendriks</title> <title>Richard Hendriks</title>
<meta name="description" content="Richard hails from Tulsa. He has earned degrees from the University of Oklahoma and Stanford. (Go Sooners and Cardinal!) Before starting Pied Piper, he worked for Hooli as a part time software developer. While his work focuses on applied information theory, mostly optimizing lossless compression schema of both the length-limited and adaptive variants, his non-work interests range widely, everything from quantum computing to chaos theory. He could tell you about it, but THAT would NOT be a “length-limited” conversation!"> <meta name="description" content="Richard hails from Tulsa. He has earned degrees from the University of Oklahoma and Stanford. (Go Sooners and Cardinal!) Before starting Pied Piper, he worked for Hooli as a part time software developer. While his work focuses on applied information theory, mostly optimizing lossless compression schema of both the length-limited and adaptive variants, his non-work interests range widely, everything from quantum computing to chaos theory. He could tell you about it, but THAT would NOT be a “length-limited” conversation!">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap">
<style>:root { <style>:root {