We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61af3ad commit a047b5cCopy full SHA for a047b5c
quartz/plugins/emitters/aliases.ts
@@ -16,14 +16,18 @@ async function* processFile(ctx: BuildCtx, file: VFile) {
16
) as FullSlug
17
18
const redirUrl = resolveRelative(aliasTargetSlug, ogSlug)
19
+ // Create absolute URL for canonical and meta refresh
20
+ const baseUrl = ctx.cfg.configuration.baseUrl || ""
21
+ const absoluteUrl = baseUrl ? `https://${baseUrl}/${ogSlug}` : redirUrl
22
+
23
yield write({
24
ctx,
25
content: `
26
<!DOCTYPE html>
27
<html lang="en-us">
28
<head>
29
<title>${ogSlug}</title>
- <link rel="canonical" href="${redirUrl}">
30
+ <link rel="canonical" href="${absoluteUrl}">
31
<meta name="robots" content="noindex">
32
<meta charset="utf-8">
33
<meta http-equiv="refresh" content="0; url=${redirUrl}">
0 commit comments