mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-19 22:29:16 +00:00
refactor: move emit from callback to helper file function (#704)
* Change emit from callback to helpers file function * Update docs, remove commented code, improve type sig
This commit is contained in:
parent
af811d824f
commit
ce3dd0923b
14 changed files with 69 additions and 58 deletions
quartz/plugins/emitters
|
@ -7,6 +7,7 @@ import { FilePath, FullSlug } from "../../util/path"
|
|||
import { sharedPageComponents } from "../../../quartz.layout"
|
||||
import { NotFound } from "../../components"
|
||||
import { defaultProcessedContent } from "../vfile"
|
||||
import { write } from "./helpers"
|
||||
|
||||
export const NotFoundPage: QuartzEmitterPlugin = () => {
|
||||
const opts: FullPageLayout = {
|
||||
|
@ -25,7 +26,7 @@ export const NotFoundPage: QuartzEmitterPlugin = () => {
|
|||
getQuartzComponents() {
|
||||
return [Head, Body, pageBody, Footer]
|
||||
},
|
||||
async emit(ctx, _content, resources, emit): Promise<FilePath[]> {
|
||||
async emit(ctx, _content, resources): Promise<FilePath[]> {
|
||||
const cfg = ctx.cfg.configuration
|
||||
const slug = "404" as FullSlug
|
||||
|
||||
|
@ -48,7 +49,8 @@ export const NotFoundPage: QuartzEmitterPlugin = () => {
|
|||
}
|
||||
|
||||
return [
|
||||
await emit({
|
||||
await write({
|
||||
ctx,
|
||||
content: renderPage(slug, componentData, opts, externalResources),
|
||||
slug,
|
||||
ext: ".html",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue