File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 1
- import fs from 'fs'
2
- import path from 'path'
3
- import { fileURLToPath } from 'url'
4
- import matter from 'gray-matter'
5
- import glob from 'glob'
6
-
7
- const __filename = fileURLToPath ( import . meta. url )
8
- const __dirname = path . dirname ( __filename )
1
+ const fs = require ( 'fs' )
2
+ const path = require ( 'path' )
3
+ const matter = require ( 'gray-matter' )
4
+ const glob = require ( 'glob' )
9
5
10
6
// Get list of all article and commentary folders
11
7
const articles = fs
@@ -74,9 +70,15 @@ const supplementMetadata = glob
74
70
75
71
// Generate the metadata file content
76
72
const fileContent = `// This file is auto-generated. Do not edit it manually.
77
- export const articleMetadata = ${ JSON . stringify ( articleMetadata , null , 2 ) }
78
- export const commentaryMetadata = ${ JSON . stringify ( commentaryMetadata , null , 2 ) }
79
- export const supplementMetadata = ${ JSON . stringify ( supplementMetadata , null , 2 ) }
73
+ const articleMetadata = ${ JSON . stringify ( articleMetadata ) }
74
+ const commentaryMetadata = ${ JSON . stringify ( commentaryMetadata ) }
75
+ const supplementMetadata = ${ JSON . stringify ( supplementMetadata ) }
76
+
77
+ module.exports = {
78
+ articleMetadata,
79
+ commentaryMetadata,
80
+ supplementMetadata,
81
+ }
80
82
`
81
83
82
84
// Write the metadata file
You can’t perform that action at this time.
0 commit comments