Skip to content

Commit 8ef3150

Browse files
committed
포맷팅 수정
1 parent 9ecce54 commit 8ef3150

2 files changed

Lines changed: 65 additions & 64 deletions

File tree

src/data/breadcrumb.json

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
{
22
"breadcrumb": {
3-
"get-started": "시작하기",
4-
"get-docker": "Docker 설치",
5-
"docker-overview": "Docker 개요",
6-
"introduction": "소개",
7-
"build-and-push-first-image": "첫 번째 이미지 빌드 및 푸시",
8-
"develop-with-containers": "컨테이너로 개발",
9-
"get-docker-desktop": "Docker Desktop 설치",
10-
"whats-next": "다음 단계",
11-
"docker-concepts": "Docker 개념",
12-
"the-basics": "기본 사항",
13-
"what-is-a-container": "컨테이너란?",
14-
"what-is-a-registry": "레지스트리란?",
15-
"what-is-an-image": "이미지란?",
16-
"what-is-docker-compose": "Docker Compose란?",
17-
"building-images": "이미지 빌드",
18-
"understanding-image-layers": "이미지 레이어 이해",
19-
"writing-a-dockerfile": "Dockerfile 작성",
20-
"build-tag-and-publish-an-image": "이미지 빌드, 태그, 게시",
21-
"using-the-build-cache": "빌드 캐시 사용",
22-
"multi-stage-builds": "멀티 스테이지 빌드",
23-
"running-containers": "컨테이너 실행",
24-
"multi-container-applications": "멀티 컨테이너 애플리케이션",
25-
"overriding-container-defaults": "컨테이너 기본값 재정의",
26-
"persisting-container-data": "컨테이너 데이터 유지",
27-
"publishing-ports": "포트 게시",
28-
"sharing-local-files": "로컬 파일 공유",
29-
"docker-workshop": "Docker 워크샵",
30-
"resources": "리소스",
31-
"workshop": "워크샵",
32-
"02_our_app": "애플리케이션 컨테이너화",
33-
"03_updating_app": "애플리케이션 업데이트",
34-
"04_sharing_app": "애플리케이션 공유",
35-
"05_persisting_data": "데이터베이스 유지",
36-
"06_bind_mounts": "바인드 마운트 사용",
37-
"07_multi_container": "멀티 컨테이너 애플리케이션",
38-
"08_using_compose": "Docker Compose 사용",
39-
"09_image_best": "이미지 빌드 모범 사례",
40-
"10_what_next": "Docker 워크숍 이후 단계"
41-
}
3+
"get-started": "시작하기",
4+
"get-docker": "Docker 설치",
5+
"docker-overview": "Docker 개요",
6+
"introduction": "소개",
7+
"build-and-push-first-image": "첫 번째 이미지 빌드 및 푸시",
8+
"develop-with-containers": "컨테이너로 개발",
9+
"get-docker-desktop": "Docker Desktop 설치",
10+
"whats-next": "다음 단계",
11+
"docker-concepts": "Docker 개념",
12+
"the-basics": "기본 사항",
13+
"what-is-a-container": "컨테이너란?",
14+
"what-is-a-registry": "레지스트리란?",
15+
"what-is-an-image": "이미지란?",
16+
"what-is-docker-compose": "Docker Compose란?",
17+
"building-images": "이미지 빌드",
18+
"understanding-image-layers": "이미지 레이어 이해",
19+
"writing-a-dockerfile": "Dockerfile 작성",
20+
"build-tag-and-publish-an-image": "이미지 빌드, 태그, 게시",
21+
"using-the-build-cache": "빌드 캐시 사용",
22+
"multi-stage-builds": "멀티 스테이지 빌드",
23+
"running-containers": "컨테이너 실행",
24+
"multi-container-applications": "멀티 컨테이너 애플리케이션",
25+
"overriding-container-defaults": "컨테이너 기본값 재정의",
26+
"persisting-container-data": "컨테이너 데이터 유지",
27+
"publishing-ports": "포트 게시",
28+
"sharing-local-files": "로컬 파일 공유",
29+
"docker-workshop": "Docker 워크샵",
30+
"resources": "리소스",
31+
"workshop": "워크샵",
32+
"02_our_app": "애플리케이션 컨테이너화",
33+
"03_updating_app": "애플리케이션 업데이트",
34+
"04_sharing_app": "애플리케이션 공유",
35+
"05_persisting_data": "데이터베이스 유지",
36+
"06_bind_mounts": "바인드 마운트 사용",
37+
"07_multi_container": "멀티 컨테이너 애플리케이션",
38+
"08_using_compose": "Docker Compose 사용",
39+
"09_image_best": "이미지 빌드 모범 사례",
40+
"10_what_next": "Docker 워크숍 이후 단계"
41+
}
4242
}

src/scripts/breadcrumb.ts

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ interface BreadcrumbItem {
66
}
77

88
interface TranslationData {
9-
breadcrumb: Record<string, string>;
10-
}
9+
breadcrumb: Record<string, string>;
10+
}
1111

1212
/**
1313
* 경로 세그먼트를 번역합니다.
1414
* @param segment 번역할 세그먼트
15-
* @returns 번역된 텍스트 또는 원본 텍스트
15+
* @returns 번역된 텍스트 또는 원본 텍스트
1616
*/
1717
function translatePathSegment(segment: string): string {
1818
const translationData = translations as TranslationData;
@@ -24,27 +24,25 @@ function translatePathSegment(segment: string): string {
2424
*/
2525
function generateBreadcrumbItems(): BreadcrumbItem[] {
2626
const hash = window.location.hash.slice(1); // # 제거
27-
27+
2828
if (!hash || hash === '/') {
2929
return [{ name: '홈', path: '#/' }];
3030
}
3131

32-
const pathSegments = hash.split('/').filter(segment => segment !== '');
33-
const breadcrumbItems: BreadcrumbItem[] = [
34-
{ name: '홈', path: '#/' }
35-
];
32+
const pathSegments = hash.split('/').filter((segment) => segment !== '');
33+
const breadcrumbItems: BreadcrumbItem[] = [{ name: '홈', path: '#/' }];
3634

3735
let currentPath = '';
38-
36+
3937
pathSegments.forEach((segment) => {
4038
currentPath += `/${segment}`;
41-
39+
4240
// 세그먼트 이름을 한국어로 변환
4341
const displayName = translatePathSegment(segment);
44-
42+
4543
breadcrumbItems.push({
4644
name: displayName,
47-
path: `#${currentPath}`
45+
path: `#${currentPath}`,
4846
});
4947
});
5048

@@ -57,20 +55,23 @@ function generateBreadcrumbItems(): BreadcrumbItem[] {
5755
function createBreadcrumbElement(items: BreadcrumbItem[]): HTMLElement {
5856
const breadcrumbNav = document.createElement('nav');
5957
breadcrumbNav.id = 'breadcrumbs';
60-
breadcrumbNav.className = 'pb-3 flex min-w-0 items-center gap-2 text-gray-400 dark:text-gray-300';
58+
breadcrumbNav.className =
59+
'pb-3 flex min-w-0 items-center gap-2 text-gray-400 dark:text-gray-300';
6160

6261
// HTML 문자열로 breadcrumb 구조 생성
63-
const breadcrumbHTML = items.map((item, index) => {
64-
const isLast = index === items.length - 1;
65-
66-
if (isLast) {
67-
// 현재 페이지는 span으로 표시
68-
return `<span class="truncate">${item.name}</span>`;
69-
} else {
70-
// 이전 페이지들은 링크로 표시 + 구분자
71-
return `<a href="${item.path}" class="link truncate">${item.name}</a> / `;
72-
}
73-
}).join('');
62+
const breadcrumbHTML = items
63+
.map((item, index) => {
64+
const isLast = index === items.length - 1;
65+
66+
if (isLast) {
67+
// 현재 페이지는 span으로 표시
68+
return `<span class="truncate">${item.name}</span>`;
69+
} else {
70+
// 이전 페이지들은 링크로 표시 + 구분자
71+
return `<a href="${item.path}" class="link truncate">${item.name}</a> / `;
72+
}
73+
})
74+
.join('');
7475

7576
breadcrumbNav.innerHTML = breadcrumbHTML;
7677
return breadcrumbNav;
@@ -100,5 +101,5 @@ export function initializeBreadcrumb(): void {
100101
const breadcrumbElement = createBreadcrumbElement(breadcrumbItems);
101102

102103
// div#content의 첫 번째 자식으로 추가
103-
contentDiv.insertBefore(breadcrumbElement, contentDiv.firstChild);
104+
contentDiv.insertBefore(breadcrumbElement, contentDiv.firstChild);
104105
}

0 commit comments

Comments
 (0)