| 
									
										
										
										
											2016-01-19 02:11:58 -08:00
										 |  |  | var path = require('canonical-path'); | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * dgProcessor | 
					
						
							|  |  |  |  * @description | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | module.exports = function renderAsJadeProcessor() { | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     $runAfter: ['readFilesProcessor'], | 
					
						
							|  |  |  |     $runBefore: ['writing-files'], | 
					
						
							|  |  |  |     $process: function(docs) { | 
					
						
							|  |  |  |       return docs.map(function(doc) { | 
					
						
							|  |  |  |         var fileInfo = doc.fileInfo; | 
					
						
							|  |  |  |         doc.renderedContent =  doc.content ; | 
					
						
							|  |  |  |         var regionSuffix =  (doc.regionName && doc.regionName.length) ? "-" + doc.regionName.trim() : ""; | 
					
						
							|  |  |  |         var origName = fileInfo.baseName + "." + fileInfo.extension; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-15 12:53:57 -08:00
										 |  |  |         //var newName = "_." + fileInfo.baseName + regionSuffix +  "." + fileInfo.extension;
 | 
					
						
							|  |  |  |         var newName = "./_fragments/" + fileInfo.baseName + regionSuffix +  "." + fileInfo.extension; | 
					
						
							| 
									
										
										
										
											2016-01-19 02:11:58 -08:00
										 |  |  |         doc.outputPath = fileInfo.filePath.replace(origName, newName); | 
					
						
							|  |  |  |         return doc; | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | }; |