mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-11-30 09:47:56 +01:00
fix: coerce fullslug
Some checks failed
Build and Test / build-and-test (ubuntu-latest) (push) Has been skipped
Build and Test / publish-tag (push) Has been skipped
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Some checks failed
Build and Test / build-and-test (ubuntu-latest) (push) Has been skipped
Build and Test / publish-tag (push) Has been skipped
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { isRelativeURL, resolveRelative, simplifySlug } from "../../util/path"
|
||||
import { FullSlug, isRelativeURL, resolveRelative, simplifySlug } from "../../util/path"
|
||||
import { QuartzEmitterPlugin } from "../types"
|
||||
import { write } from "./helpers"
|
||||
import { BuildCtx } from "../../util/ctx"
|
||||
@@ -9,9 +9,11 @@ async function* processFile(ctx: BuildCtx, file: VFile) {
|
||||
const ogSlug = simplifySlug(file.data.slug!)
|
||||
|
||||
for (const aliasTarget of file.data.aliases ?? []) {
|
||||
const aliasTargetSlug = isRelativeURL(aliasTarget)
|
||||
? path.normalize(path.join(ogSlug, "..", aliasTarget))
|
||||
: aliasTarget
|
||||
const aliasTargetSlug = (
|
||||
isRelativeURL(aliasTarget)
|
||||
? path.normalize(path.join(ogSlug, "..", aliasTarget))
|
||||
: aliasTarget
|
||||
) as FullSlug
|
||||
|
||||
const redirUrl = resolveRelative(aliasTargetSlug, ogSlug)
|
||||
yield write({
|
||||
|
||||
Reference in New Issue
Block a user