File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+
3
+ export interface PostFooterProps {
4
+ date : string ;
5
+ }
6
+
7
+ export function PostFooter ( { date } : PostFooterProps ) {
8
+ return (
9
+ < >
10
+ < hr />
11
+ < p >
12
+ < small >
13
+ Published on { date } .< br />
14
+ Questions? Comments? Corrections? Kudos? Find me on < a href = "https://twitter.com/atcb" > Twitter</ a > .
15
+ </ small >
16
+ </ p >
17
+ </ >
18
+ ) ;
19
+ }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import 'katex/dist/katex.min.css';
13
13
import { shallowClone } from '../utils/shallowClone' ;
14
14
import SEO from '../components/SEO' ;
15
15
import { ErrorCatcher } from '../components/ErrorCatcher' ;
16
+ import { PostFooter } from '../components/PostFooter' ;
16
17
17
18
const renderAst = new RehypeReact ( {
18
19
createElement : React . createElement ,
@@ -45,6 +46,7 @@ export interface PostProps {
45
46
frontmatter : {
46
47
title : string ;
47
48
lib : import ( '../utils/typescript/types' ) . Extra [ ] ;
49
+ date : string ;
48
50
} ;
49
51
} ;
50
52
} ;
@@ -64,7 +66,8 @@ export const query = graphql`
64
66
htmlAst,
65
67
frontmatter {
66
68
title,
67
- lib
69
+ lib,
70
+ date(formatString: "MMMM DD, YYYY")
68
71
}
69
72
}
70
73
}
@@ -254,6 +257,7 @@ function Post({ data, pageContext }: PostProps) {
254
257
< EditableContext . Provider value = { context } >
255
258
< div > { renderAst ( data . markdownRemark . htmlAst ) } </ div >
256
259
</ EditableContext . Provider >
260
+ < PostFooter date = { post . frontmatter . date } />
257
261
</ div >
258
262
</ Layout >
259
263
) ;
You can’t perform that action at this time.
0 commit comments