Skip to content

Commit 2fcacfe

Browse files
committed
some style changes
1 parent b0a2eb5 commit 2fcacfe

File tree

3 files changed

+19
-44
lines changed

3 files changed

+19
-44
lines changed

prerender-urls.js

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

src/routes/blog/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ const blogs = (props) => {
1010
return (<h1>Loading</h1>);
1111
}
1212

13-
if (data && data.data && data.data.content) {
14-
return (<Markdown>{ data.data.content }</Markdown>);
13+
if (data && data.data) {
14+
return (
15+
<article class={style.blogcontainer}>
16+
<h1 class={style.blogtitle}>{data.data.title}</h1>
17+
<div class={style.blogbody}>
18+
<Markdown>{ data.data.content }</Markdown>
19+
</div>
20+
</article>
21+
);
1522
}
1623

1724
return (<h1>Blog</h1>);

src/routes/blog/style.css

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,15 @@
1-
.pageBlogs {
2-
padding: 0 5%;
1+
.blogcontainer {
2+
max-width: 728px;
3+
width: 100%;
4+
margin: 0 auto 10em;
5+
line-height: 1.5;
36
}
47

5-
.pageTitle {
6-
position: relative;
7-
display: inline-block;
8+
.blogtitle {
9+
font-size: 1.8rem;
810
font-weight: 500;
9-
font-family: serif;
1011
}
1112

12-
.pageTitle:after {
13-
position: absolute;
14-
bottom: -5px;
15-
left: 0px;
16-
content: '';
17-
width: 75%;
18-
border-bottom: 2px solid #FFC107;
19-
}
20-
21-
h2 {
22-
font-weight: 400;
23-
font-size: 24px;
24-
margin: 48px 0 12px 0;
25-
}
26-
27-
.tag {
28-
padding: 4px 8px;
29-
margin-left: 8px;
30-
text-transform: lowercase;
31-
background-color: #ffdd037c;
32-
border-radius: 5px;
33-
color: #999;
34-
font-size: 12px;
35-
}
36-
37-
.tag:first-child {
38-
margin-left: 0px;
39-
}
40-
41-
.preview {
42-
width: 50%;
43-
line-height: 1.3;
44-
color: #666;
45-
max-height: 80px;
46-
overflow: hidden;
47-
text-overflow: ellipsis;
13+
.blogbody {
14+
font-size: 1.2rem;
4815
}

0 commit comments

Comments
 (0)