@@ -6,8 +6,8 @@ import rehypeRaw from 'rehype-raw';
66
77// Wrapper component to access URL parameters
88const ArticlesWrapper = ( props ) => {
9- const params = useParams ( ) ;
10- return < Articles { ...props } slug = { params . slug } /> ;
9+ const params = useParams ( ) ;
10+ return < Articles { ...props } slug = { params . slug } /> ;
1111} ;
1212
1313function parseMetadata ( text ) {
@@ -105,11 +105,10 @@ class Articles extends Component {
105105 < button
106106 key = { i }
107107 onClick = { ( ) => this . handlePageChange ( i ) }
108- className = { `px-3 py-1 mx-1 rounded ${
109- currentPage === i
108+ className = { `px-3 py-1 mx-1 rounded ${ currentPage === i
110109 ? 'bg-blue-500 text-white'
111110 : 'bg-gray-200 text-gray-700 hover:bg-gray-300'
112- } `}
111+ } `}
113112 >
114113 { i }
115114 </ button >
@@ -146,6 +145,9 @@ class Articles extends Component {
146145 < div className = "article" >
147146 < div className = "article-header" >
148147 < h1 > { article . metadata . title } </ h1 >
148+ < small className = "text-muted" >
149+ Published: < time dateTime = { article . metadata . date } > { article . metadata . date } </ time >
150+ </ small >
149151 </ div >
150152 < div className = "article-body" >
151153 < ReactMarkdown children = { article . text } skipHtml = { false } rehypePlugins = { [ rehypeRaw ] } />
@@ -157,22 +159,22 @@ class Articles extends Component {
157159 </ div >
158160 </ div >
159161 < div className = "col-md-4" >
160- < div className = "section-title" >
161- < h2 > Article List</ h2 >
162- </ div >
163- < div className = "article-list" >
164- < ul >
165- { articles . map ( ( article ) => (
166- < li key = { article . metadata . slug } >
167- < Link to = { `/articles/${ article . metadata . slug } ` } >
168- { article . metadata . title }
169- </ Link >
170- </ li >
171- ) ) }
172- </ ul >
162+ < div className = "section-title" >
163+ < h2 > Article List</ h2 >
164+ </ div >
165+ < div className = "article-list" >
166+ < ul >
167+ { articles . map ( ( article ) => (
168+ < li key = { article . metadata . slug } >
169+ < Link to = { `/articles/${ article . metadata . slug } ` } >
170+ { article . metadata . title }
171+ </ Link >
172+ </ li >
173+ ) ) }
174+ </ ul >
175+ </ div >
173176 </ div >
174177 </ div >
175- </ div >
176178 </ div >
177179 </ section >
178180 ) ;
0 commit comments