Skip to content

Commit 47bff9b

Browse files
committed
blog page styling
1 parent 2195de7 commit 47bff9b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/routes/blog/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ const blogs = (props) => {
1111
}
1212

1313
if (data && data.data) {
14+
const { details, content } = data.data;
1415
return (
1516
<article class={style.blogcontainer}>
16-
<h1 class={style.blogtitle}>{data.data.details.title}</h1>
17-
<caption class={style.blogsubtitle}>{data.data.details.subtitle}</caption>
17+
<h1 class={style.blogtitle}>{details.title}</h1>
18+
{ details.subtitle && <caption class={style.blogsubtitle}>{details.subtitle}</caption> }
19+
{ details.cover && <img class={style.blogcover} src={details.cover} /> }
1820
<div class={style.blogbody}>
19-
<Markdown>{ data.data.content }</Markdown>
21+
<Markdown>{ content }</Markdown>
2022
</div>
2123
</article>
2224
);

src/routes/blog/style.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.blogtitle {
99
font-size: 2.2rem;
1010
font-weight: 400;
11+
margin-bottom: 0;
1112
}
1213

1314
.blogbody {
@@ -19,8 +20,13 @@
1920
}
2021

2122
.blogsubtitle {
22-
font-weight:300;
23-
color: #999;
23+
color: #aaa;
2424
display: block;
25+
text-align: left;
26+
font-size: 1.2rem;
27+
margin-bottom: 2rem;
28+
}
2529

30+
.blogcover {
31+
width: 100%;
2632
}

0 commit comments

Comments
 (0)