listMarkdownPages #

Every Markdown page below scope.sourceRoot, in the order the site itself reads them: directories before their content, both sorted by name, files outside the public directory only.

Usage #

TypeScript
import { 
listMarkdownPages
} from 'kawapress/generator'
const
pages
= await
listMarkdownPages
({
sourceRoot
: '/site' })

Parameters

scopeMarkdownPageScope

Where the pages of the site are.

sourceRootstring

Absolute directory holding the Markdown sources, that is the resolved srcDir.

publicDiroptionalstring

Absolute directory of files that are copied as they are, that is the resolved publicDir. Markdown inside it is not a page. Leave it out when the site has no public directory.

excludeoptionalreadonly string[]

Glob patterns, relative to sourceRoot, of Markdown files that are not pages, that is the resolved srcExclude. Leave it out to keep every file.

rewritesoptionalPageRewrites

rewrites of the site config, which moves pages to other routes.

Returns The pages, in reading order.

Full type signature
TypeScript
function listMarkdownPages(scope: MarkdownPageScope): Promise<MarkdownPage[]>

Edit this page

Comments