mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
v2: prepare to move
This commit is contained in:
parent
dc7ef96849
commit
45736200b0
172 changed files with 0 additions and 0 deletions
18
v2/lib/load/pages.js
Normal file
18
v2/lib/load/pages.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
const globby = require('globby');
|
||||
const {encodePath, fileToPath} = require('./utils');
|
||||
|
||||
async function loadPages(pagesDir) {
|
||||
const pagesFiles = await globby(['**/*.js'], {
|
||||
cwd: pagesDir
|
||||
});
|
||||
|
||||
const pagesMetadatas = await Promise.all(
|
||||
pagesFiles.map(async source => ({
|
||||
path: encodePath(fileToPath(source)),
|
||||
source
|
||||
}))
|
||||
);
|
||||
return pagesMetadatas;
|
||||
}
|
||||
|
||||
module.exports = loadPages;
|
Loading…
Add table
Add a link
Reference in a new issue