fix(path): correct socialUrl rendering

Currently, socialUrl is incorrectly rendered as https:/baseUrl/path, with a
missing slash in ://.

Since socialUrl is only used when cfg.baseUrl is defined, we can simplify by
using cfg.baseUrl directly, excluding the scheme portion of the URL.
This commit is contained in:
moexiami 2024-12-31 20:11:03 +08:00
parent a934397961
commit cb730c10da
No known key found for this signature in database
GPG Key ID: 53E2BDD8BD17882C

View File

@ -152,7 +152,9 @@ export default (() => {
// Url of current page // Url of current page
const socialUrl = const socialUrl =
fileData.slug === "404" ? url.toString() : joinSegments(url.toString(), fileData.slug!) fileData.slug === "404"
? url.toString()
: `https://${joinSegments(cfg.baseUrl, fileData.slug!)}`
return ( return (
<head> <head>