Skip to content

Commit ecc1840

Browse files
authored
[#657] 네비게이션 스키마 작성 (#660)
* feat: 네비게이션 스키마 마크업 * chore: constants 메타데이터 import export문 수정 * feat: 네비게이션 스키마 적용 * refactor: NavigationSchemaScript 컴포넌트 분리
1 parent f34d416 commit ecc1840

File tree

5 files changed

+61
-4
lines changed

5 files changed

+61
-4
lines changed

src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import AuthFailedErrorBoundary from '@/components/common/AuthFailedErrorBoundary
77
import PWAServiceWorkerProvider from '@/components/common/PWAServiceWorkerProvider';
88
import ReactQueryProvider from '@/components/common/ReactQueryProvider';
99
import ToastProvider from '@/components/common/Toast/ToastProvider';
10+
import NavigationSchemaScript from '@/components/common/NavigationSchemaScript';
1011
import Layout from '@/components/layout/Layout';
1112

1213
import { LineSeedKR } from '@/styles/font';
@@ -52,6 +53,7 @@ const RootLayout = ({ children }: { children: React.ReactNode }) => {
5253
</ReactQueryProvider>
5354
</ToastProvider>
5455
</PWAServiceWorkerProvider>
56+
<NavigationSchemaScript />
5557
</body>
5658
</html>
5759
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Script from 'next/script';
2+
3+
import { navigationSchemaItems } from '@/constants/metadata/schema';
4+
5+
const navigationSchema = {
6+
'@context': 'https://schema.org',
7+
'@type': 'ItemList',
8+
itemListElement: navigationSchemaItems,
9+
};
10+
11+
const NavigationSchemaScript = () => {
12+
return (
13+
<Script
14+
id="navigation-schema"
15+
type="application/ld+json"
16+
dangerouslySetInnerHTML={{ __html: JSON.stringify(navigationSchema) }}
17+
/>
18+
);
19+
};
20+
21+
export default NavigationSchemaScript;

src/constants/metadata/appleSplashScreens.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const appleSplashScreens = [
1+
export const appleSplashScreens = [
22
{
33
rel: 'apple-touch-startup-image',
44
media:
@@ -228,5 +228,3 @@ const appleSplashScreens = [
228228
url: '/images/splash-screens/8.3__iPad_Mini_portrait.png',
229229
},
230230
];
231-
232-
export default appleSplashScreens;

src/constants/metadata/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export { default as appleSplashScreens } from './appleSplashScreens';
1+
export * from './appleSplashScreens';
2+
export * from './schema';

src/constants/metadata/schema.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const baseUrl = new URL(`${process.env.NEXT_HOST}`);
2+
3+
export const navigationSchemaItems = [
4+
{
5+
'@type': 'SiteNavigationElement',
6+
position: 1,
7+
name: '북카이브',
8+
description:
9+
'같은 직군인 유저들의 책장과 인기 도서를 추천받고 인사이트를 넓혀보세요',
10+
url: `${baseUrl}bookarchive`,
11+
},
12+
{
13+
'@type': 'SiteNavigationElement',
14+
position: 2,
15+
name: '도서검색',
16+
description:
17+
'평소에 궁금했거나 함께 이야기 나누고 싶은 도서를 검색해보세요',
18+
url: `${baseUrl}book/search`,
19+
},
20+
{
21+
'@type': 'SiteNavigationElement',
22+
position: 3,
23+
name: '독서모임',
24+
description:
25+
'읽고 싶은 책을 선정하고 모임에 참여하여 멤버들과 이야기를 나눠보세요',
26+
url: `${baseUrl}group`,
27+
},
28+
{
29+
'@type': 'SiteNavigationElement',
30+
position: 4,
31+
name: '내프로필',
32+
description: '내 책장을 관리하고 참여한 독서 모임들을 확인해보세요',
33+
url: `${baseUrl}profile/me`,
34+
},
35+
];

0 commit comments

Comments
 (0)