oxen-website/utils/metadata.ts

13 lines
359 B
TypeScript
Raw Normal View History

2021-01-22 03:43:42 +01:00
import { METADATA } from '../constants';
2021-03-02 07:00:34 +01:00
import { titleCase } from './text';
2021-01-22 03:43:42 +01:00
export function generateTitle(prefix: string) {
2021-02-15 04:22:26 +01:00
return prefix
2021-03-02 07:00:34 +01:00
? `${titleCase(prefix)} - ${METADATA.TITLE_SUFFIX}`
2021-02-15 04:22:26 +01:00
: METADATA.TITLE_SUFFIX;
2021-01-22 03:43:42 +01:00
}
export function generateURL(prefix: string) {
return prefix ? `${METADATA.OXEN_HOST_URL}${prefix}` : METADATA.OXEN_HOST_URL;
}