Repository navigation
Expand file tree
/
Copy pathsite.ts
More file actions
30 lines (25 loc) · 1.31 KB
/
Copy pathsite.ts
File metadata and controls
30 lines (25 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* The canonical origin of the site. Everything SEO — canonical URLs, the
* sitemap, robots.txt, Open Graph image URLs — is absolute, so this has to be
* right in production.
*
* `NEXT_PUBLIC_SITE_URL` overrides everything (use it for previews and staging).
* Otherwise a production build points at the real domain and a dev build at
* localhost, so neither needs any configuration to be correct.
*/
export const PRODUCTION_URL = "https://visualdsa.nextjoblist.com";
const fallback =
process.env.NODE_ENV === "production" ? PRODUCTION_URL : "http://localhost:3000";
// Deliberately not falling back to VERCEL_PROJECT_PRODUCTION_URL: that can hand
// back a *.vercel.app host, which would publish canonicals pointing away from
// the real domain and split the site's ranking across two origins.
export const SITE_URL = (process.env.NEXT_PUBLIC_SITE_URL ?? fallback).replace(
/\/$/,
"",
);
export const SITE_NAME = "Visual DSA";
export const SITE_DESCRIPTION =
"Learn data structures and algorithms by watching them run. 44 interactive lessons with step-by-step animations — arrays, sorting, trees, graphs, dynamic programming — free, from zero experience.";
/** Absolute URL for a site-relative path. */
export const url = (path = "/"): string =>
`${SITE_URL}${path.startsWith("/") ? path : `/${path}`}`;