| 2 | import { loadPages } from '../../lib/page-data.js' |
| 3 | |
| 4 | export default async function findIndexablePages(match = '') { |
| 5 | const allPages = await loadPages() |
| 6 | const indexablePages = allPages |
| 7 | // exclude hidden pages |
| 8 | .filter((page) => !page.hidden) |
| 9 | // exclude pages that are part of WIP or hidden products |
| 10 | .filter((page) => !page.parentProduct || !page.parentProduct.wip || page.parentProduct.hidden) |
| 11 | // exclude absolute home page (e.g. /en or /ja) |
| 12 | .filter((page) => page.relativePath !== 'index.md') |
| 13 | .filter((page) => !match || page.relativePath.includes(match)) |
| 14 | |
| 15 | console.log('total pages', allPages.length) |
| 16 | console.log('indexable pages', indexablePages.length) |
| 17 | return indexablePages |
| 18 | } |