mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
fix: fix style
This commit is contained in:
parent
502c8abd39
commit
149fd16260
@ -11,12 +11,14 @@ async function* processFile(ctx: BuildCtx, file: VFile) {
|
||||
for (const aliasTarget of file.data.aliases ?? []) {
|
||||
let aliasTargetSlug: FullSlug
|
||||
|
||||
if (aliasTarget.startsWith('/')) {
|
||||
if (aliasTarget.startsWith("/")) {
|
||||
// Root-absolute paths: /index -> index
|
||||
aliasTargetSlug = aliasTarget.slice(1) as FullSlug
|
||||
} else {
|
||||
// Everything else is relative to current directory: ./file, ../folder/file, index, xxx/yyy
|
||||
aliasTargetSlug = path.posix.normalize(path.posix.join(path.posix.dirname(ogSlug), aliasTarget)) as FullSlug
|
||||
aliasTargetSlug = path.posix.normalize(
|
||||
path.posix.join(path.posix.dirname(ogSlug), aliasTarget),
|
||||
) as FullSlug
|
||||
}
|
||||
|
||||
const redirUrl = resolveRelative(aliasTargetSlug, ogSlug)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user