1
0
mirror of synced 2025-12-20 10:28:40 -05:00
Files
docs/script/search/find-indexable-pages.js
Kevin Heis 8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00

18 lines
643 B
JavaScript

#!/usr/bin/env node
import { loadPages } from '../../lib/page-data.js'
export default async function findIndexablePages() {
const allPages = await loadPages()
const indexablePages = allPages
// exclude hidden pages
.filter((page) => !page.hidden)
// exclude pages that are part of WIP or hidden products
.filter((page) => !page.parentProduct || !page.parentProduct.wip || page.parentProduct.hidden)
// exclude index homepages
.filter((page) => !page.relativePath.endsWith('index.md'))
console.log('total pages', allPages.length)
console.log('indexable pages', indexablePages.length)
return indexablePages
}