Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(seo): next-seo 적용 #39

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"eslint": "8.38.0",
"eslint-config-next": "13.3.0",
"next": "13.3.0",
"next-seo": "^6.1.0",
"react": "18.2.0",
"react-device-detect": "^2.2.3",
"react-dom": "18.2.0",
Expand Down
Binary file added public/static/images/og-kakao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/DetailCheck/DetailCheck.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
font-weight: 700;
letter-spacing: -0.06em;
text-align: center;
color: var(--black);

@include tablet {
margin-top: 5rem;
Expand Down
4 changes: 2 additions & 2 deletions src/components/DetailEasy/DeatailEasy.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Image from 'next/image';

import onbardingSrc from '../../../public/static/images/onboarding.webp';
import onboardingSrc from '../../../public/static/images/onboarding.webp';

import Styles from './DetailEasy.module.scss';

Expand All @@ -26,7 +26,7 @@ export default function DetailEasy(): JSX.Element {
<div className={Styles.DetailEasy__imageWrapper}>
<div className={Styles.DetailEasy__imageWrapper__image}>
<Image
src={onbardingSrc}
src={onboardingSrc}
alt="onboarding image"
style={{ width: '100%', height: 'auto' }}
priority
Expand Down
1 change: 1 addition & 0 deletions src/components/DetailEasy/DetailEasy.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
margin-bottom: 2rem;
font-size: 2.5rem;
font-weight: 700;
color: var(--black);

@include tablet {
font-size: 2rem;
Expand Down
47 changes: 47 additions & 0 deletions src/constants/objects/seo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export default {
titleTemplate: '%s | 기억하고 싶은 모든 콘텐츠를 내 손안에',
description: '기억하고 싶은 모든 콘텐츠를 내 손안에, HAVIT',
additionalLinkTags: [
{
rel: 'icon',
href: '/favicon.ico',
},
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/apple-touch-icon.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon-16x16.png',
},
],
openGraph: {
type: 'website',
locale: 'ko_KR',
url: 'https://www.havit.app',
title: 'HAVIT | 기억하고 싶은 모든 콘텐츠를 내 손안에',
site_name: 'HAVIT',
images: [
{
url: '/static/images/og-kakao.png',
width: 800,
height: 400,
alt: 'og image for HAVIT',
},
],
},
twitter: {
handle: '@handle',
site: 'havit.app',
cardType: 'summary_large_image',
},
};
10 changes: 9 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import '@/styles/globals.scss';
import '../../public/static/fonts/style.css';

import type { AppProps } from 'next/app';
import { DefaultSeo } from 'next-seo';

import SEO from '@/constants/objects/seo';

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
return (
<>
<DefaultSeo {...SEO} />
<Component {...pageProps} />
</>
);
}
33 changes: 2 additions & 31 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Head from 'next/head';
import { NextSeo } from 'next-seo';

import { Main } from '@/components/Main';
import { DetailEasy } from '@/components/DetailEasy';
Expand All @@ -12,36 +12,7 @@ import styles from '@/styles/Home.module.scss';
export default function Home() {
return (
<>
<Head>
<title>HAVIT | 기억하고 싶은 모든 콘텐츠를 내 손안에</title>
<meta
name="description"
content="기억하고 싶은 모든 콘텐츠를 내 손안에, HAVIT"
/>
{/* <meta name="viewport" content="width=device-width, initial-scale=1" /> */}
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1, minimum-scale=1"
></meta>
<link rel="icon" href="/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon-16x16.png"
/>
</Head>
<NextSeo title="HAVIT" canonical="https://havit.app" />
<main className={styles.main}>
<Main />
<DetailEasy />
Expand Down