mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-14 07:26:50 +00:00
fix: ensure canonical URL pathname consistency
This commit is contained in:
@@ -12,9 +12,9 @@ const { channel } = Astro.props
|
||||
const locale = getEnv(import.meta.env, Astro, 'LOCALE')
|
||||
|
||||
const seo = channel?.seo
|
||||
const canonical = SITE_URL.startsWith('http')
|
||||
? new URL(SITE_URL).origin + Astro.url.pathname
|
||||
: Astro.url.origin + Astro.url.pathname
|
||||
const reqPathname = Astro.url.pathname.replace(/\/$/, '')
|
||||
const canonical = SITE_URL.startsWith('http') ? new URL(SITE_URL).origin + reqPathname : Astro.url.origin + reqPathname
|
||||
|
||||
const { origin, pathname } = new URL(canonical)
|
||||
const twitter = getEnv(import.meta.env, Astro, 'TWITTER')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user