Skip to content

Commit c9e5dd4

Browse files
authored
Add date under title (tokio-rs#708)
1 parent 08b6b98 commit c9e5dd4

10 files changed

+25
-8
lines changed

components/content.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export default function Content({
112112
prev,
113113
body,
114114
mdPath,
115+
description,
115116
}) {
116117
const isBlogRoute = href.startsWith("/blog");
117118

@@ -146,9 +147,14 @@ export default function Content({
146147
<section className="section content">
147148
<div className="columns">
148149
<div className="column is-two-thirds tk-markdown" ref={mdRef}>
149-
<h1 className="title" id="">
150+
<h1 className={`title ${isBlogRoute ? 'blog-title' : ''}`} id="">
150151
{title}
151152
</h1>
153+
{isBlogRoute && (
154+
<p className="description">
155+
{description}
156+
</p>
157+
)}
152158
<div dangerouslySetInnerHTML={{ __html: body }}></div>
153159
<Footer next={next} prev={prev} mdPath={mdPath} />
154160
</div>

content/blog/2017-01-tokio-0-1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2017-01-10"
33
title: "Announcing Tokio 0.1"
4-
description: "10 January 2017"
4+
description: "January 10, 2017"
55
---
66

77
Today we are publishing the preliminary version of the Tokio stack, 0.1!

content/blog/2017-03-tokio-io.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2017-03-17"
33
title: "Announcing the tokio-io Crate"
4-
description: "17 March 2017"
4+
description: "March 17, 2017"
55
---
66

77
Today we're happy to announce a new crate and several new tools to work with in

content/blog/2017-09-tokio-reform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2017-09-19"
33
title: "An RFC for a Tokio revamp"
4-
description: "19 September 2017"
4+
description: "September 19, 2017"
55
---
66

77
Hi there, Tokio community!

content/blog/2018-02-tokio-reform-shipped.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2018-02-07"
33
title: "Tokio Reform is Shipped and the Road to 0.2"
4-
description: "07 February 2018"
4+
description: "February 7, 2018"
55
---
66

77
Hi all!

content/blog/2018-03-timers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2018-03-30"
33
title: "New Timer implementation"
4-
description: "30 March 2018"
4+
description: "March 30, 2018"
55
---
66

77
Happy Friday all!

content/blog/2018-03-tokio-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2018-03-08"
33
title: "Announcing the Tokio runtime"
4-
description: "08 March 2018"
4+
description: "March 8, 2018"
55
---
66

77
I'm happy to announce a new release of Tokio. This release includes the first

lib/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export function loadPage(path) {
197197
mdPath,
198198
data: res.data,
199199
body: res.content,
200+
description: res.data.description || null,
200201
};
201202
}
202203

lib/page.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Layout from "../components/layout";
44
export default function Page({
55
app,
66
menu,
7-
page: { next, prev, href, title, body, mdPath },
7+
page: { next, prev, href, title, body, mdPath, description },
88
}) {
99
return (
1010
<>
@@ -17,6 +17,7 @@ export default function Page({
1717
prev={prev}
1818
body={body}
1919
mdPath={mdPath}
20+
description={description}
2021
/>
2122
</Layout>
2223
</>

styles/styles.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,10 @@ a:active {
727727
@tablet {
728728
font-size: 2.5rem;
729729
}
730+
731+
&.blog-title {
732+
margin-bottom : 0rem;
733+
}
730734
}
731735

732736
h1:not(.title) {
@@ -802,6 +806,11 @@ a:active {
802806
a:hover code {
803807
color: darken($magenta);
804808
}
809+
810+
.description {
811+
margin-bottom: 1.5rem;
812+
color: $dark-gray;
813+
}
805814
}
806815
}
807816

0 commit comments

Comments
 (0)