avoid 404 on icon for spa navigations with anchors

This commit is contained in:
Jacky Zhao 2023-08-19 16:40:02 -07:00
parent dd47be1bc6
commit 78f4cdbe10
2 changed files with 5 additions and 3 deletions
quartz/components

View file

@ -1,4 +1,4 @@
import { pathToRoot } from "../util/path"
import { joinSegments, pathToRoot } from "../util/path"
import { JSResourceToScriptElement } from "../util/resources"
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
@ -8,7 +8,7 @@ export default (() => {
const description = fileData.description?.trim() ?? "No description provided"
const { css, js } = externalResources
const baseDir = pathToRoot(fileData.slug!)
const iconPath = baseDir + "/static/icon.png"
const iconPath = joinSegments(baseDir, "static/icon.png")
const ogImagePath = `https://${cfg.baseUrl}/static/og-image.png`
return (