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';
1313import { shallowClone } from '../utils/shallowClone' ;
1414import SEO from '../components/SEO' ;
1515import { ErrorCatcher } from '../components/ErrorCatcher' ;
16+ import { PostFooter } from '../components/PostFooter' ;
1617
1718const renderAst = new RehypeReact ( {
1819 createElement : React . createElement ,
@@ -45,6 +46,7 @@ export interface PostProps {
4546 frontmatter : {
4647 title : string ;
4748 lib : import ( '../utils/typescript/types' ) . Extra [ ] ;
49+ date : string ;
4850 } ;
4951 } ;
5052 } ;
@@ -64,7 +66,8 @@ export const query = graphql`
6466 htmlAst,
6567 frontmatter {
6668 title,
67- lib
69+ lib,
70+ date(formatString: "MMMM DD, YYYY")
6871 }
6972 }
7073 }
@@ -254,6 +257,7 @@ function Post({ data, pageContext }: PostProps) {
254257 < EditableContext . Provider value = { context } >
255258 < div > { renderAst ( data . markdownRemark . htmlAst ) } </ div >
256259 </ EditableContext . Provider >
260+ < PostFooter date = { post . frontmatter . date } />
257261 </ div >
258262 </ Layout >
259263 ) ;
You can’t perform that action at this time.
0 commit comments