Skip to content

Commit 2195de7

Browse files
authored
Merge pull request #1 from prateekbh/blog-details
Update prerender-urls.js
2 parents e8e8892 + ee96b5b commit 2195de7

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

content/blog/how-to-share-a-screenshot-of-the-page.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
22
title: How to share a screenshot of the page
33
date: 2019-09-07T05:42:28.441Z
4-
subtitle: >-
5-
If you have ever built an application which needs to take a screenshot of
6-
itself, then this blog tells you how to do the same for web.
4+
subtitle: If you have ever built an application which needs to take a screenshot of itself, then this blog tells you how to do the same for web.
75
cover: /assets/cody-black-nm89mzvar5i-unsplash.jpg
86
tags: 'technology, javascript'
97
---

prerender-urls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = () => {
2020
return {
2121
url: `/blog/${blog.id}`,
2222
data: {
23-
title: blog.details.title,
23+
details: blog.details,
2424
content: data
2525
}
2626
};

src/routes/blog/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const blogs = (props) => {
1313
if (data && data.data) {
1414
return (
1515
<article class={style.blogcontainer}>
16-
<h1 class={style.blogtitle}>{data.data.title}</h1>
16+
<h1 class={style.blogtitle}>{data.data.details.title}</h1>
17+
<caption class={style.blogsubtitle}>{data.data.details.subtitle}</caption>
1718
<div class={style.blogbody}>
1819
<Markdown>{ data.data.content }</Markdown>
1920
</div>

src/routes/blog/style.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@
1616

1717
.blogbody img {
1818
max-width: 100%;
19-
}
19+
}
20+
21+
.blogsubtitle {
22+
font-weight:300;
23+
color: #999;
24+
display: block;
25+
26+
}

src/static/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ collections:
1212
fields:
1313
- { label: "Title", name: "title", widget: "string"}
1414
- { label: "Publish Date", name: "date", widget: "datetime" }
15-
- { label: "Subtitle", name: "subtitle", widget: "text"}
15+
- { label: "Subtitle", name: "subtitle", widget: "string"}
1616
- { label: "Cover", name: "cover", widget: "image"}
1717
- { label: "Tags", name: "tags", widget: "string" }
1818
- { label: "Body", name: "body", widget: "markdown"}

0 commit comments

Comments
 (0)