|
|
|
@ -16,7 +16,8 @@ import {
|
|
|
|
|
LocaleConfig,
|
|
|
|
|
DefaultTheme,
|
|
|
|
|
APPEARANCE_KEY,
|
|
|
|
|
createLangDictionary
|
|
|
|
|
createLangDictionary,
|
|
|
|
|
PageData
|
|
|
|
|
} from './shared'
|
|
|
|
|
import { resolveAliases, DEFAULT_THEME_PATH } from './alias'
|
|
|
|
|
import { MarkdownOptions } from './markdown/markdown'
|
|
|
|
@ -77,6 +78,23 @@ export interface UserConfig<ThemeConfig = any> {
|
|
|
|
|
* @param siteConfig The resolved configuration.
|
|
|
|
|
*/
|
|
|
|
|
buildEnd?: (siteConfig: SiteConfig) => Promise<void>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* HTML transform hook: runs before writing HTML to dist.
|
|
|
|
|
*/
|
|
|
|
|
transformHtml?: (
|
|
|
|
|
code: string,
|
|
|
|
|
id: string,
|
|
|
|
|
ctx: {
|
|
|
|
|
siteConfig: SiteConfig
|
|
|
|
|
siteData: SiteData
|
|
|
|
|
pageData: PageData
|
|
|
|
|
title: string
|
|
|
|
|
description: string
|
|
|
|
|
head: HeadConfig[]
|
|
|
|
|
content: string
|
|
|
|
|
}
|
|
|
|
|
) => Promise<string | void>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type RawConfigExports<ThemeConfig = any> =
|
|
|
|
@ -95,6 +113,7 @@ export interface SiteConfig<ThemeConfig = any>
|
|
|
|
|
| 'lastUpdated'
|
|
|
|
|
| 'ignoreDeadLinks'
|
|
|
|
|
| 'buildEnd'
|
|
|
|
|
| 'transformHtml'
|
|
|
|
|
> {
|
|
|
|
|
root: string
|
|
|
|
|
srcDir: string
|
|
|
|
@ -174,7 +193,8 @@ export async function resolveConfig(
|
|
|
|
|
shouldPreload: userConfig.shouldPreload,
|
|
|
|
|
mpa: !!userConfig.mpa,
|
|
|
|
|
ignoreDeadLinks: userConfig.ignoreDeadLinks,
|
|
|
|
|
buildEnd: userConfig.buildEnd
|
|
|
|
|
buildEnd: userConfig.buildEnd,
|
|
|
|
|
transformHtml: userConfig.transformHtml
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return config
|
|
|
|
|