resolveMarkdownPageScope #

The pages of a resolved site config: the scope KawaPress itself uses to list pages, with absolute source and public folders.

Usage #

TypeScript
import { 
definePlugin
} from 'kawapress'
import {
resolveMarkdownPageScope
} from 'kawapress/generator'
export default
definePlugin
({
name
: 'scope',
setup
(
api
) {
api
.
configResolved
((
site
) => {
console
.
log
(
resolveMarkdownPageScope
(
site
).
sourceRoot
)
}) }, })

Parameters

siteResolvedSiteConfig

The resolved site config that configResolved() received.

rootstring

Absolute path of the site root, the folder of kawapress.config.ts.

titlestring

Site title.

descriptionoptionalstring

Description of pages that set none in frontmatter or locale config.

basestring

Deploy path, always starting and ending with /.

srcDirstring

Markdown source folder, relative to root.

srcExcludereadonly string[]

Glob patterns, relative to srcDir, of Markdown files that are not pages.

rewritesPageRewrites | undefined

The rules that move pages to other routes, if any.

publicDirstring

Public folder, relative to srcDir.

headreadonly HeadConfig[]

Tags added to the <head> of every page.

themeConfigReadonly<Partial<ThemeConfig>>

Theme settings.

localesReadonly<Record<string, LocaleConfig>>

Every locale; a site without locales has an English root locale.

Returns The scope to list pages with.

Full type signature
TypeScript
function resolveMarkdownPageScope(site: ResolvedSiteConfig): MarkdownPageScope

Edit this page

Comments