feat: add utils | page

This commit is contained in:
kmacoders
2021-07-01 00:06:02 +07:00
parent e843aa1d7f
commit 5036d3602f
6 changed files with 174 additions and 0 deletions

6
utils/getRoutes.js Normal file
View File

@@ -0,0 +1,6 @@
export default async () => {
const { $content } = require('@nuxt/content');
const files = await $content({ deep: true }).only(['path']).fetch();
return files.map((file) => (file.path === '/index' ? '/' : file.path));
};