CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/landing/util.ts
Views: 687
1
import { join } from "path";
2
import basePath from "lib/base-path";
3
4
export function MediaURL(url) {
5
if (typeof url != "string") {
6
// e.g., a module import destined for the optimized next Image component.
7
return url;
8
}
9
if (url.includes("://")) {
10
return url;
11
}
12
return join(basePath, url);
13
}
14
15