This is to tidy up the `author-packagse`, which currently duplicates a lot of the configuration in the main packages. We need to DRY this up so that we don't fall foul of a change in one being missed in the other.
		
			
				
	
	
		
			19 lines
		
	
	
		
			503 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			503 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /**
 | |
|  * Read in JSON files
 | |
|  */
 | |
| module.exports = function jsonFileReader() {
 | |
|   return {
 | |
|     name: 'jsonFileReader',
 | |
|     getDocs: function(fileInfo) {
 | |
| 
 | |
|       // We return a single element array because content files only contain one document
 | |
|       return [{
 | |
|         docType: fileInfo.baseName + '-json',
 | |
|         data: JSON.parse(fileInfo.content),
 | |
|         template: 'json-doc.template.json',
 | |
|         id: fileInfo.baseName,
 | |
|         aliases: [fileInfo.baseName, fileInfo.relativePath]
 | |
|       }];
 | |
|     }
 | |
|   };
 | |
| }; |