diff --git a/front/app/orgs/[orgslug]/(withmenu)/collection/[collectionid]/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/collection/[collectionid]/page.tsx index 51efcfd5..ad1e8569 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/collection/[collectionid]/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/collection/[collectionid]/page.tsx @@ -23,11 +23,25 @@ export async function generateMetadata( const org = await getOrganizationContextInfo(params.orgslug, { revalidate: 1800, tags: ['organizations'] }); const col = await getCollectionByIdWithAuthHeader(params.collectionid, access_token ? access_token : null, { revalidate: 0, tags: ['collections'] }); - - + // SEO return { title: `Collection : ${col.name} — ${org.name}`, description: `${col.description} `, + robots: { + index: true, + follow: true, + nocache: true, + googleBot: { + index: true, + follow: true, + "max-image-preview": "large", + } + }, + openGraph: { + title: `Collection : ${col.name} — ${org.name}`, + description: `${col.description} `, + type: 'website', + }, }; } diff --git a/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx index 0e6310e2..82399971 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/collections/page.tsx @@ -22,9 +22,26 @@ export async function generateMetadata( const cookieStore = cookies(); // Get Org context information const org = await getOrganizationContextInfo(params.orgslug, { revalidate: 1800, tags: ['organizations'] }); + + // SEO return { title: `Collections — ${org.name}`, description: `Collections of courses from ${org.name}`, + robots: { + index: true, + follow: true, + nocache: true, + googleBot: { + index: true, + follow: true, + "max-image-preview": "large", + } + }, + openGraph: { + title: `Collections — ${org.name}`, + description: `Collections of courses from ${org.name}`, + type: 'website', + }, }; } diff --git a/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/activity/[activityid]/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/activity/[activityid]/page.tsx index 0f642018..18940c5c 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/activity/[activityid]/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/activity/[activityid]/page.tsx @@ -23,9 +23,28 @@ export async function generateMetadata( const course_meta = await getCourseMetadataWithAuthHeader(params.courseid, { revalidate: 0, tags: ['courses'] }, access_token ? access_token : null) const activity = await getActivityWithAuthHeader(params.activityid, { revalidate: 0, tags: ['activities'] }, access_token ? access_token : null) + // SEO return { title: activity.name + ` — ${course_meta.course.name} Course`, description: course_meta.course.mini_description, + keywords: course_meta.course.learnings, + robots: { + index: true, + follow: true, + nocache: true, + googleBot: { + index: true, + follow: true, + "max-image-preview": "large", + } + }, + openGraph: { + title: activity.name + ` — ${course_meta.course.name} Course`, + description: course_meta.course.mini_description, + type: activity.type === 'video' ? 'video.other' : 'article', + publishedTime: course_meta.course.creationDate, + tags: course_meta.course.learnings, + }, }; } diff --git a/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx index f224e72e..dac4a9ba 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx @@ -17,19 +17,37 @@ export async function generateMetadata( const cookieStore = cookies(); const access_token = await getAccessTokenFromRefreshTokenCookie(cookieStore) - // Get Org context information const org = await getOrganizationContextInfo(params.orgslug, { revalidate: 1800, tags: ['organizations'] }); const course_meta = await getCourseMetadataWithAuthHeader(params.courseid, { revalidate: 0, tags: ['courses'] }, access_token ? access_token : null) + + // SEO return { title: course_meta.course.name + ` — ${org.name}`, description: course_meta.course.mini_description, + keywords: course_meta.course.learnings, + robots: { + index: true, + follow: true, + nocache: true, + googleBot: { + index: true, + follow: true, + "max-image-preview": "large", + } + }, + openGraph: { + title: course_meta.course.name + ` — ${org.name}`, + description: course_meta.course.mini_description, + type: 'article', + publishedTime: course_meta.course.creationDate, + tags: course_meta.course.learnings, + }, }; } - const CoursePage = async (params: any) => { const cookieStore = cookies(); const courseid = params.params.courseid diff --git a/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx index e0ff84f9..11345bff 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/courses/page.tsx @@ -18,9 +18,27 @@ export async function generateMetadata( // Get Org context information const org = await getOrganizationContextInfo(params.orgslug, { revalidate: 1800, tags: ['organizations'] }); + + // SEO return { title: "Courses — " + org.name, description: org.description, + keywords: `${org.name}, ${org.description}, courses, learning, education, online learning, edu, online courses, ${org.name} courses`, + robots: { + index: true, + follow: true, + nocache: true, + googleBot: { + index: true, + follow: true, + "max-image-preview": "large", + } + }, + openGraph: { + title: "Courses — " + org.name, + description: org.description, + type: 'website', + }, }; } diff --git a/front/app/orgs/[orgslug]/(withmenu)/page.tsx b/front/app/orgs/[orgslug]/(withmenu)/page.tsx index 63a5fe65..83675fb2 100644 --- a/front/app/orgs/[orgslug]/(withmenu)/page.tsx +++ b/front/app/orgs/[orgslug]/(withmenu)/page.tsx @@ -22,13 +22,28 @@ type MetadataProps = { export async function generateMetadata( { params }: MetadataProps, ): Promise { - - // Get Org context information const org = await getOrganizationContextInfo(params.orgslug, { revalidate: 1800, tags: ['organizations'] }); + + // SEO return { title: `Home — ${org.name}`, description: org.description, + robots: { + index: true, + follow: true, + nocache: true, + googleBot: { + index: true, + follow: true, + "max-image-preview": "large", + } + }, + openGraph: { + title: `Home — ${org.name}`, + description: org.description, + type: 'website', + }, }; }