mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-05 20:02:47 +01:00
24 lines
643 B
JavaScript
24 lines
643 B
JavaScript
export const OFFICIAL_SITE_URL = 'https://www.bentopdf.com';
|
|
|
|
export function resolveSiteUrl() {
|
|
return (process.env.SITE_URL || OFFICIAL_SITE_URL).replace(/\/+$/, '');
|
|
}
|
|
|
|
export function isOfficialSiteUrl(url = resolveSiteUrl()) {
|
|
try {
|
|
const { hostname } = new URL(url);
|
|
return hostname === 'www.bentopdf.com' || hostname === 'bentopdf.com';
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export function canonicalBasePath() {
|
|
if (isOfficialSiteUrl()) return '';
|
|
return (process.env.BASE_URL || '/').replace(/\/$/, '');
|
|
}
|
|
|
|
export function isIndexingBlocked() {
|
|
return !isOfficialSiteUrl() && process.env.ALLOW_INDEXING !== 'true';
|
|
}
|