94 lines
3.4 KiB
TypeScript
94 lines
3.4 KiB
TypeScript
import type { ParsedRouteParams } from './dataHelper'
|
|
import { getShortRegionName } from './dataHelper'
|
|
|
|
export function generateSeoMeta(parsed: ParsedRouteParams, siteName = '클래식 유니클래스', siteDomain = 'https://soohyun.cloud') {
|
|
const { sido, sigungu, dong, shortRegionName, grade, subjectName, targetTerm, fullKeyword } = parsed
|
|
|
|
const regionTitle = shortRegionName || getShortRegionName(sido, dong)
|
|
const pageTitle = `${regionTitle} ${grade} ${subjectName} 과외 | ${dong} 내신·수능 1:1 맞춤수업 - ${siteName}`
|
|
const pageDescription = `${sido} ${sigungu} ${dong} 지역 초·중·고 ${grade} ${subjectName} 1:1 전문 과외. 인근 학교별 기출 족보 완벽 분석, 서술형 감점 방지, 취약 개념 클리닉 및 맞춤 학습 플래너 제공. 지금 ${dong} 무료 학습 진단 및 모의수업을 신청하세요.`
|
|
|
|
// 표준 Canonical URL
|
|
const canonicalUrl = `${siteDomain}/${encodeURIComponent(dong)}-${encodeURIComponent(grade)}-${encodeURIComponent(subjectName)}`
|
|
|
|
const jsonLd = {
|
|
'@context': 'https://schema.org',
|
|
'@graph': [
|
|
{
|
|
'@type': 'EducationalOrganization',
|
|
'name': siteName,
|
|
'url': siteDomain,
|
|
'description': pageDescription,
|
|
'areaServed': {
|
|
'@type': 'AdministrativeArea',
|
|
'name': `${sido} ${sigungu} ${dong}`
|
|
}
|
|
},
|
|
{
|
|
'@type': 'Course',
|
|
'name': `${dong} ${grade} ${subjectName} 1:1 맞춤 과외`,
|
|
'description': `${dong} 인근 학교 내신 출제 경향 분석 및 ${subjectName} 1등급 도약 커리큘럼`,
|
|
'provider': {
|
|
'@type': 'Organization',
|
|
'name': siteName
|
|
}
|
|
},
|
|
{
|
|
'@type': 'BreadcrumbList',
|
|
'itemListElement': [
|
|
{
|
|
'@type': 'ListItem',
|
|
'position': 1,
|
|
'name': '홈',
|
|
'item': siteDomain
|
|
},
|
|
{
|
|
'@type': 'ListItem',
|
|
'position': 2,
|
|
'name': sido,
|
|
'item': `${siteDomain}/${encodeURIComponent(sido)}`
|
|
},
|
|
{
|
|
'@type': 'ListItem',
|
|
'position': 3,
|
|
'name': sigungu,
|
|
'item': `${siteDomain}/${encodeURIComponent(sigungu)}`
|
|
},
|
|
{
|
|
'@type': 'ListItem',
|
|
'position': 4,
|
|
'name': `${dong} ${subjectName}`,
|
|
'item': canonicalUrl
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
|
|
return {
|
|
title: pageTitle,
|
|
meta: [
|
|
{ name: 'description', content: pageDescription },
|
|
{ name: 'keywords', content: `${dong}과외, ${dong}${subjectName}과외, ${dong}${grade}과외, ${sigungu}과외, ${dong}학원, ${dong}내신대비, ${subjectName}1:1과외` },
|
|
{ property: 'og:type', content: 'website' },
|
|
{ property: 'og:title', content: pageTitle },
|
|
{ property: 'og:description', content: pageDescription },
|
|
{ property: 'og:url', content: canonicalUrl },
|
|
{ property: 'og:site_name', content: siteName },
|
|
{ property: 'og:image', content: `${siteDomain}/img/og-preview.png` },
|
|
{ name: 'twitter:card', content: 'summary_large_image' },
|
|
{ name: 'twitter:title', content: pageTitle },
|
|
{ name: 'twitter:description', content: pageDescription }
|
|
],
|
|
link: [
|
|
{ rel: 'canonical', href: canonicalUrl }
|
|
],
|
|
script: [
|
|
{
|
|
type: 'application/ld+json',
|
|
children: JSON.stringify(jsonLd)
|
|
}
|
|
]
|
|
}
|
|
}
|