MCPcopy Create free account
hub / github.com/github/docs / findIndexablePages

Function findIndexablePages

script/search/find-indexable-pages.js:4–18  ·  view source on GitHub ↗
(match = '')

Source from the content-addressed store, hash-verified

2import { loadPages } from '../../lib/page-data.js'
3
4export 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}

Callers 1

syncSearchIndexesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected