@@ -30,7 +30,8 @@ function compile( continuation ) {
3030}
3131
3232function findFiles ( continuation ) {
33- var finder = require ( "findit" ) . find ( OUTPUT_DIR ) ;
33+ var finder = require ( "findit" ) . find ( OUTPUT_DIR ) ,
34+ ts = new Date ( ) ;
3435
3536 finder . on ( "file" , function ( file ) {
3637 var locPath = file . replace ( OUTPUT_DIR , "" ) ,
@@ -40,9 +41,9 @@ function findFiles( continuation ) {
4041 if ( isHome ) {
4142 // TODO: Deal with home page
4243 } else if ( isCategory ) {
43- site . categories . push ( { path : file } )
44+ site . categories . push ( { path : file , isCategory : true , date : ts } )
4445 } else if ( locPath . indexOf ( "/assets/" ) != 0 ) {
45- site . articles . push ( { path : file } ) ;
46+ site . articles . push ( { path : file , isCategory : false , date : ts } ) ;
4647 }
4748 } ) ;
4849
@@ -66,6 +67,7 @@ function processCategories( continuation ) {
6667 if ( meta ) {
6768 _ . extend ( cat , JSON . parse ( meta . textContent ) )
6869 cat . contents = _ . trim ( cat . contents . replace ( META_REGEX , "" ) ) ;
70+ cat . slug = cat . chapter ;
6971 }
7072 } ) ;
7173 continuation ( ) ;
@@ -86,15 +88,13 @@ function processArticles( continuation ) {
8688 } ) ;
8789 } ,
8890 function processMeta ( err , windows ) {
89- var ts = new Date ( ) ;
9091 windows . forEach ( function ( win , index ) {
9192 var meta = win . document . getElementById ( 'nanoc_meta' ) ,
9293 file = site . articles [ index ] ;
9394 if ( meta ) {
9495 _ . extend ( file , JSON . parse ( meta . textContent ) )
9596 file . contents = _ . trim ( file . contents . replace ( META_REGEX , "" ) ) ;
9697 file . slug = file . filename . replace ( "/" + file . chapter + "/" , "" ) . replace ( "/index.html" , "" ) ;
97- file . date = ts ;
9898 }
9999 } ) ;
100100 continuation ( ) ;
0 commit comments