feat: support course meta tags (#421)
* support course meta tags * fix import
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { MetaTagsProps } from 'svelte-meta-tags';
|
||||
import { dev, browser } from '$app/environment';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { blockedSubdomain } from '$lib/utils/constants/app';
|
||||
@@ -16,6 +17,7 @@ interface LoadOutput {
|
||||
isOrgSite: boolean;
|
||||
skipAuth: boolean;
|
||||
org: CurrentOrg | null;
|
||||
baseMetaTags: MetaTagsProps;
|
||||
}
|
||||
|
||||
export const load = async ({ url, cookies }): Promise<LoadOutput> => {
|
||||
@@ -23,7 +25,8 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
|
||||
orgSiteName: '',
|
||||
isOrgSite: false,
|
||||
skipAuth: false,
|
||||
org: null
|
||||
org: null,
|
||||
baseMetaTags: getBaseMetaTags(url)
|
||||
};
|
||||
|
||||
// Selfhosted usecase would be here
|
||||
@@ -98,6 +101,44 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
|
||||
return response;
|
||||
};
|
||||
|
||||
function getBaseMetaTags(url: URL) {
|
||||
return Object.freeze({
|
||||
title: 'ClassroomIO – Launch Your Online Bootcamp In Minutes',
|
||||
description:
|
||||
'Launch your bootcamp quickly and affordably with ClassroomIO, the customizable online teaching platform.',
|
||||
canonical: new URL(url.pathname, url.origin).href,
|
||||
openGraph: {
|
||||
type: 'website',
|
||||
url: new URL(url.pathname, url.origin).href,
|
||||
locale: 'en_IE',
|
||||
title: 'ClassroomIO – Launch Your Online Bootcamp In Minutes',
|
||||
description:
|
||||
'Launch your bootcamp quickly and affordably with ClassroomIO, the customizable online teaching platform.',
|
||||
siteName: 'ClassroomIO',
|
||||
images: [
|
||||
{
|
||||
url: 'https://classroomio.com/classroomio-opengraph-image.png',
|
||||
alt: 'ClassroomIO OG Image',
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
secureUrl: 'https://classroomio.com/classroomio-opengraph-image.png',
|
||||
type: 'image/jpeg'
|
||||
}
|
||||
]
|
||||
},
|
||||
twitter: {
|
||||
handle: '@classroomio',
|
||||
site: '@classroomio',
|
||||
cardType: 'summary_large_image',
|
||||
title: 'ClassroomIO – Launch Your Online Bootcamp In Minutes',
|
||||
description:
|
||||
'Launch your bootcamp quickly and affordably with ClassroomIO, the customizable online teaching platform.',
|
||||
image: 'https://classroomio.com/classroomio-opengraph-image.png',
|
||||
imageAlt: 'ClassroomIO OG Image'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Define getInitialLocale function
|
||||
function getInitialLocale(): string {
|
||||
if (browser) {
|
||||
|
||||
Reference in New Issue
Block a user