ui 개편 완료

This commit is contained in:
2026-11-11 12:18:47 +09:00
parent 67a7fa0326
commit 15e8bcd37b
145 changed files with 141907 additions and 23029 deletions
+5 -4
View File
@@ -4,6 +4,7 @@ export default defineEventHandler((event) => {
const config = useRuntimeConfig()
const baseUrl = config.public.siteDomain || 'https://soohyun.cloud'
const list = regionsData.list as Array<{ sido: string, sigungu: string, dong: string }>
const uniqueDongs = Array.from(new Set(list.map(r => r.dong).filter(Boolean)))
const today = new Date().toISOString().split('T')[0]
const subjects = ['수학', '영어', '국어', '과학', '사회']
@@ -29,16 +30,16 @@ export default defineEventHandler((event) => {
xml += ` <image:image><image:loc>${baseUrl}/img/social-studies-tutoring.png</image:loc></image:image>\n`
xml += ` </url>\n`
// 동별 주요 과목 및 학년 URL 생성 (슬래시 라우터 구조 통일)
list.forEach(r => {
// 중복 제거된 동별 주요 과목 및 학년 URL 생성 (슬래시 라우터 구조 통일)
uniqueDongs.forEach(dong => {
// 1. 동 대표
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`
xml += ` <url>\n <loc>${baseUrl}/${encodeURIComponent(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. 동/학년/과목 조합
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`
xml += ` <url>\n <loc>${baseUrl}/${encodeURIComponent(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`
})
})
})