방식 개편

This commit is contained in:
2026-11-05 14:07:55 +09:00
parent 6d78eccb65
commit 67a7fa0326
156 changed files with 107591 additions and 12747 deletions
+3 -3
View File
@@ -29,8 +29,8 @@ export default defineEventHandler(async (event) => {
}
const webhookUrl = config.discordWebhookUrl || 'https://discordapp.com/api/webhooks/1557204310369116210/9J4y96kmSbYNGtw5OxRgIz7InWcM8o3f8UX0Ad71-IyofwdS7tWmXkF7dj457-I8Ypiu'
const siteName = config.public.siteName || '1:1 맞춤과외'
const siteDomain = config.public.siteDomain || 'https://aeseo.cloud'
const siteName = config.public.siteName || '쌤인증'
const siteDomain = config.public.siteDomain || 'https://soohyun.xyz'
// 한국 시간 (KST)
const now = new Date()
@@ -53,7 +53,7 @@ export default defineEventHandler(async (event) => {
{
title: `[신규 무료 상담 신청 접수] ${finalLocation} - ${finalGrade} (${finalStudentName} 학생)`,
description: `**${siteName}** 사이트에서 새로운 1:1 학습 상담 신청이 접수되었습니다.`,
color: 0x991b1b, // 신뢰감 있는 딥 레드/네이비
color: 0x991b1b,
fields: [
{
name: "[접수 사이트]",
+27 -9
View File
@@ -4,24 +4,42 @@ export default defineEventHandler((event) => {
const config = useRuntimeConfig()
const baseUrl = config.public.siteDomain || 'https://soohyun.xyz'
const list = regionsData.list as Array<{ sido: string, sigungu: string, dong: string }>
const today = new Date().toISOString().split('T')[0]
const subjects = ['영어', '수학', '국어', '통합과학', '통합사회']
const grades = ['중학생', '고등학생']
const subjects = ['수학', '영어', '국어', '과학', '사회']
const grades = ['초등학생', '중학생', '고등학생']
const subjectImages: Record<string, string> = {
'수학': `${baseUrl}/img/math-tutoring.png`,
'영어': `${baseUrl}/img/english-tutoring.png`,
'국어': `${baseUrl}/img/korean-tutoring.png`,
'과학': `${baseUrl}/img/science-tutoring.png`,
'사회': `${baseUrl}/img/social-studies-tutoring.png`
}
let xml = `<?xml version="1.0" encoding="UTF-8"?>\n`
xml += `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n`
xml += `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">\n`
// 메인
xml += ` <url>\n <loc>${baseUrl}/</loc>\n <changefreq>daily</changefreq>\n <priority>1.0</priority>\n </url>\n`
xml += ` <url>\n <loc>${baseUrl}/</loc>\n <lastmod>${today}</lastmod>\n <changefreq>daily</changefreq>\n <priority>1.0</priority>\n`
xml += ` <image:image><image:loc>${baseUrl}/img/og-main.png</image:loc></image:image>\n`
xml += ` <image:image><image:loc>${baseUrl}/img/math-tutoring.png</image:loc></image:image>\n`
xml += ` <image:image><image:loc>${baseUrl}/img/english-tutoring.png</image:loc></image:image>\n`
xml += ` <image:image><image:loc>${baseUrl}/img/korean-tutoring.png</image:loc></image:image>\n`
xml += ` <image:image><image:loc>${baseUrl}/img/science-tutoring.png</image:loc></image:image>\n`
xml += ` <image:image><image:loc>${baseUrl}/img/social-studies-tutoring.png</image:loc></image:image>\n`
xml += ` </url>\n`
// 568개 동별 주요 과목 및 학년 URL 생성
// 동별 주요 과목 및 학년 URL 생성 (슬래시 라우터 구조 통일)
list.forEach(r => {
// 1. 동 대표
xml += ` <url>\n <loc>${baseUrl}/${encodeURIComponent(r.dong)}</loc>\n <changefreq>weekly</changefreq>\n <priority>0.8</priority>\n </url>\n`
xml += ` <url>\n <loc>${baseUrl}/${encodeURIComponent(r.dong)}</loc>\n <lastmod>${today}</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.8</priority>\n <image:image><image:loc>${baseUrl}/img/math-tutoring.png</image:loc></image:image>\n </url>\n`
// 2. 동-과목-학년 대표 조합
subjects.slice(0, 3).forEach(sub => {
xml += ` <url>\n <loc>${baseUrl}/${encodeURIComponent(r.dong)}-${encodeURIComponent(grades[0])}-${encodeURIComponent(sub)}</loc>\n <changefreq>weekly</changefreq>\n <priority>0.7</priority>\n </url>\n`
// 2. 동/학년/과목 조합
grades.forEach(g => {
subjects.forEach(sub => {
const imgLoc = subjectImages[sub] || `${baseUrl}/img/math-tutoring.png`
xml += ` <url>\n <loc>${baseUrl}/${encodeURIComponent(r.dong)}/${encodeURIComponent(g)}/${encodeURIComponent(sub)}</loc>\n <lastmod>${today}</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.7</priority>\n <image:image><image:loc>${imgLoc}</image:loc></image:image>\n </url>\n`
})
})
})