File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export function getArticleIndexes() {
2828 return true ;
2929 } ) ;
3030
31- const articles = years . flatMap ( ( year ) => {
31+ const articles = years . reverse ( ) . flatMap ( ( year ) => {
3232 const yearPath = path . join ( postsDirectory , year ) ;
3333 const months = fs . readdirSync ( yearPath ) . filter ( ( month ) => {
3434 const monthPath = path . join ( yearPath , month ) ;
@@ -37,15 +37,15 @@ export function getArticleIndexes() {
3737 return false ;
3838 } ) ;
3939
40- return months . flatMap ( ( month ) => {
40+ return months . reverse ( ) . flatMap ( ( month ) => {
4141 const monthPath = path . join ( yearPath , month ) ;
4242 const articleIds = fs . readdirSync ( monthPath ) . filter ( ( articleId ) => {
4343 const articlePath = path . join ( monthPath , articleId ) ;
4444 if ( ! fs . statSync ( articlePath ) . isDirectory ( ) ) return false ; // ファイルの場合はスキップ
4545 return true ;
4646 } ) ;
4747
48- return articleIds
48+ return articleIds . reverse ( )
4949 . map ( ( articleId ) => {
5050 const articleDir = path . join ( monthPath , articleId ) ;
5151 const articleFiles = fs
@@ -86,7 +86,6 @@ export function getArticleIndexes() {
8686 . flat ( ) ; // ネストされた配列を平坦化
8787 } ) ;
8888 } ) ;
89- articles . reverse ( ) ;
9089 return articles ;
9190}
9291function findThumbnailFile ( directory : string ) : string | null {
You can’t perform that action at this time.
0 commit comments