Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove deprecated env var usage #11923

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/components/PageMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ const PageMetadata: React.FC<IProps> = ({
const desc = description || t("site-description")
const siteTitle = t("site-title")
const fullTitle = `${title} | ${siteTitle}`
const origin = process.env.NEXT_PUBLIC_SITE_URL || SITE_URL // TODO: Remove .env var usage after launch

// Remove any query params (?) or hash links (#)
const path = asPath.replace(/[\?\#].*/, "")
const slug = path.split("/")

/* Set canonical URL w/ language path to avoid duplicate content */
/* e.g. set ethereum.org/about/ to ethereum.org/en/about/ */
const url = new URL(join(locale!, path), origin).href
const url = new URL(join(locale!, path), SITE_URL).href
const canonical = canonicalUrl || url

/* Set fallback ogImage based on path */
Expand All @@ -69,7 +68,7 @@ const PageMetadata: React.FC<IProps> = ({
ogImage = image
}

const ogImageUrl = new URL(ogImage, origin).href
const ogImageUrl = new URL(ogImage, SITE_URL).href
const metadata: Meta[] = [
{ name: `description`, content: desc },
{ name: `image`, content: ogImageUrl },
Expand Down