Code N Solve ๐: Gatsby ๋ธ๋ก๊ทธ ๋ฐฐํฌ
Netlify๋ฅผ ์ด์ฉํด ๋ฐฐํฌํ๋ ๊ฒ์ ํธํ์ง๋ง ์ง์ ํด๋ณด๋ ๊ฒ์ด ๋ ์ฌ๋ฏธ์๊ฒ ๋ค๊ณ ๋๊ปด์ก๋ค.1
Gatsby๋ฅผ ์ด์ฉํ ์น์ฌ์ดํธ์ ๋ฐฐํฌ ๊ณผ์ ๊ณผ ๊ฒ์ ์์ง ์ต์ ํ(SEO) ์ค์ ์ ๋ํด ์ ๋ฆฌํด๋ณด์. ์ด ๊ธ์ ์ด๋ฏธ Gatsby ๋ธ๋ก๊ทธ๋ฅผ GitHub Pages๋ Netlify์ ๋ฐฐํฌํ ์ํ๋ฅผ ์ ์ ๋ก ํ๋ค. ๋ฐฐํฌ๊น์ง๋ ์๋ฃ๋๋๋ฐ ๊ตฌ๊ธ์ ๋ด ๋ธ๋ก๊ทธ๊ฐ ๋ณด์ด์ง ์๋ ์ํฉ์ด๋ผ๋ฉด, ์ด ๊ธ์ด ๋์์ด ๋ ๊ฒ์ด๋ค.
1. SEO๋? โ ๊ฒ์ ์์ง์ ๋์ ์๋ฆฌ๋ถํฐ
1-1. SEO์ ์ ์
SEO(Search Engine Optimization)๋ ์น์ฌ์ดํธ๊ฐ ๊ตฌ๊ธ, ๋ค์ด๋ฒ ๊ฐ์ ๊ฒ์ ์์ง์์ ๋ ์ ๋ ธ์ถ๋๋๋ก ์ต์ ํํ๋ ์์ ์ด๋ค. ๋จ์ํ ํค์๋๋ฅผ ๋ง์ด ๋ฃ๋ ๊ธฐ์ ์ด ์๋๋ผ, ๊ฒ์ ์์ง์ด ์ฌ์ดํธ๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ์ดํดํ๊ณ ์ ๋ขฐํ ์ ์๋๋ก ๋๋ ์ ๋ฐ์ ์ธ ์์ ์ ๋งํ๋ค.
1-2. ๊ฒ์ ์์ง์ ์ธ ๊ฐ์ง ๋จ๊ณ
๊ฒ์ ์์ง์ด ๋ด ๋ธ๋ก๊ทธ๋ฅผ ๊ฒ์ ๊ฒฐ๊ณผ์ ๋ณด์ฌ์ฃผ๊ธฐ๊น์ง ์ธ ๋จ๊ณ๋ฅผ ๊ฑฐ์น๋ค.
1๋จ๊ณ: ํฌ๋กค๋ง(Crawling)
๊ฒ์ ์์ง์ "ํฌ๋กค๋ฌ(Crawler)" ํน์ "๋ด(Bot)"์ด๋ผ ๋ถ๋ฆฌ๋ ํ๋ก๊ทธ๋จ์ ํตํด ์ธํฐ๋ท์ ํ์ํ๋ค. ๊ตฌ๊ธ์ ํฌ๋กค๋ฌ๋ "Googlebot"์ด๋ผ๊ณ ๋ถ๋ฆฐ๋ค. ํฌ๋กค๋ฌ๋ ๋งํฌ๋ฅผ ๋ฐ๋ผ ํ์ด์ง๋ฅผ ๋ฐฉ๋ฌธํ๊ณ ํ์ด์ง ๋ด์ฉ์ ์์งํ๋ค.
ํฌ๋กค๋ง์ด ์ ๋๋ ค๋ฉด:
- ์ฌ์ดํธ ๊ตฌ์กฐ๊ฐ ๋ช ํํด์ผ ํ๋ค (๋งํฌ๊ฐ ์ ์ฐ๊ฒฐ๋ผ ์์ด์ผ ํจ)
robots.txt๋ก ํฌ๋กค๋ฌ ์ ๊ทผ์ ํ์ฉํด์ผ ํ๋คsitemap.xml์ ์ ๊ณตํด ํฌ๋กค๋ฌ๊ฐ ํ์ด์ง ๋ชฉ๋ก์ ํ๋์ ํ์ ํ ์ ์์ด์ผ ํ๋ค
2๋จ๊ณ: ์ธ๋ฑ์ฑ(Indexing)
ํฌ๋กค๋ฌ๊ฐ ์์งํ ํ์ด์ง ๋ด์ฉ์ ๋ถ์ํด ๊ฒ์ ์์ง ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅํ๋ ๊ณผ์ ์ด๋ค. ํ์ด์ง ์ ๋ชฉ, ๋ณธ๋ฌธ, ๋ฉํ ํ๊ทธ, ์ด๋ฏธ์ง ๋ฑ์ ๋ถ์ํด ํด๋น ํ์ด์ง๊ฐ ์ด๋ค ์ฃผ์ ๋ฅผ ๋ค๋ฃจ๋์ง ํ์ ํ๋ค.
์ธ๋ฑ์ฑ์ด ์ ๋๋ ค๋ฉด:
- ๋ฉํ ํ๊ทธ(
title,description)๊ฐ ๋ช ํํด์ผ ํ๋ค - ํ์ด์ง ๋ด์ฉ์ด ์ถฉ๋ถํ ํ๋ถํด์ผ ํ๋ค
- ์ค๋ณต ์ฝํ ์ธ ๊ฐ ์์ด์ผ ํ๋ค
3๋จ๊ณ: ๋ญํน(Ranking)
์ฌ์ฉ์๊ฐ ๊ฒ์์ด๋ฅผ ์ ๋ ฅํ์ ๋ ์ด๋ค ํ์ด์ง๋ฅผ ๋ช ๋ฒ์งธ์ ๋ณด์ฌ์ค์ง ๊ฒฐ์ ํ๋ ๊ณผ์ ์ด๋ค. ๊ตฌ๊ธ์ 200๊ฐ ์ด์์ ๋ญํน ์ ํธ๋ฅผ ์ฌ์ฉํ๋ค๊ณ ์๋ ค์ ธ ์๋ค. ๋ํ์ ์ธ ์์๋ ๋ค์๊ณผ ๊ฐ๋ค.
- ์ฝํ ์ธ ๊ด๋ จ์ฑ: ๊ฒ์์ด์ ํ์ด์ง ๋ด์ฉ์ด ์ผ๋ง๋ ์ผ์นํ๋๊ฐ
- ํ์ด์ง ํ์ง: ๋ด์ฉ์ด ์ถฉ๋ถํ๊ณ ์ ๋ขฐํ ์ ์๋๊ฐ
- ํ์ด์ง ๊ฒฝํ: ๋ก๋ฉ ์๋, ๋ชจ๋ฐ์ผ ์นํ์ฑ, Core Web Vitals
- ๋ฐฑ๋งํฌ: ๋ค๋ฅธ ์ฌ์ดํธ์์ ์ผ๋ง๋ ๋ง์ด ๋งํฌํ๋๊ฐ
1-3. ์ Gatsby๋ SEO์ ์ ๋ฆฌํ๊ฐ?
React ๊ธฐ๋ฐ SPA(Single Page Application)๋ JavaScript๊ฐ ์คํ๋์ด์ผ ์ฝํ ์ธ ๊ฐ ๋ ๋๋ง๋๋ค. ๊ณผ๊ฑฐ ๊ตฌ๊ธ๋ด์ JavaScript ์คํ ๋ฅ๋ ฅ์ด ์ ํ์ ์ด์๊ธฐ ๋๋ฌธ์ SPA๋ SEO์ ๋ถ๋ฆฌํ๋ค.
Gatsby๋ **์ ์ ์ฌ์ดํธ ์์ฑ๊ธฐ(Static Site Generator)**๋ก, ๋น๋ ์์ ์ HTML ํ์ผ์ ๋ฏธ๋ฆฌ ์์ฑํ๋ค. ์ด๋ฅผ ์ฌ์ ๋ ๋๋ง(Pre-rendering) ๋๋ **SSG(Static Site Generation)**๋ผ๊ณ ํ๋ค.
์ผ๋ฐ React SPA:
๋ธ๋ผ์ฐ์ โ JavaScript ๋ค์ด๋ก๋ โ React ์คํ โ HTML ์์ฑ โ ํ๋ฉด ์ถ๋ ฅ
Gatsby:
๋น๋ ์์ ์ HTML ๋ฏธ๋ฆฌ ์์ฑ โ ๋ธ๋ผ์ฐ์ ์ ๋ฐ๋ก HTML ์ ๋ฌ โ ํ๋ฉด ์ถ๋ ฅHTML์ด ์ด๋ฏธ ๋ง๋ค์ด์ ธ ์์ผ๋ฏ๋ก ๊ตฌ๊ธ๋ด์ด JavaScript ์คํ ์์ด๋ ๋ฐ๋ก ์ฝํ ์ธ ๋ฅผ ์ฝ์ ์ ์๋ค. SEO์ ์ ๋ฆฌํ๊ณ , ์ด๊ธฐ ๋ก๋ฉ ์๋๋ ๋น ๋ฅด๋ค.
2. Gatsby SEO ํ๋ฌ๊ทธ์ธ ์ค์
Gatsby๋ ํ๋ฌ๊ทธ์ธ ์ํ๊ณ๊ฐ ํ๋ถํ๋ค. SEO์ ํ์ํ ํ๋ฌ๊ทธ์ธ์ ์ค์นํ๊ณ ์ค์ ํ์.
2-1. ํ์ํ ํ๋ฌ๊ทธ์ธ ๋ชฉ๋ก
npm install gatsby-plugin-sitemap gatsby-plugin-robots-txt gatsby-plugin-react-helmet react-helmet| ํ๋ฌ๊ทธ์ธ | ์ญํ |
|---|---|
gatsby-plugin-sitemap |
sitemap.xml ์๋ ์์ฑ |
gatsby-plugin-robots-txt |
robots.txt ์๋ ์์ฑ |
gatsby-plugin-react-helmet |
<head> ํ๊ทธ ๋ฉํ๋ฐ์ดํฐ ๊ด๋ฆฌ |
react-helmet |
gatsby-plugin-react-helmet์ ์์กด์ฑ |
2-2. gatsby-config.js ์ค์
// gatsby-config.js
module.exports = {
siteMetadata: {
title: `๋ด ๋ธ๋ก๊ทธ`,
description: `๊ฐ๋ฐ ๊ณต๋ถ ๊ธฐ๋ก ๋ธ๋ก๊ทธ`,
author: `leekh8`,
siteUrl: `https://leekh8.github.io`, // ๋ฐ๋์ ์ค์ URL๋ก
},
plugins: [
// React Helmet: <head> ํ๊ทธ ๊ด๋ฆฌ
`gatsby-plugin-react-helmet`,
// Sitemap ์์ฑ
{
resolve: `gatsby-plugin-sitemap`,
options: {
output: `/sitemap.xml`,
// ํน์ ํ์ด์ง ์ ์ธ ์์
excludes: [
`/dev-404-page`,
`/404`,
`/404.html`,
],
},
},
// robots.txt ์์ฑ
{
resolve: `gatsby-plugin-robots-txt`,
options: {
host: `https://leekh8.github.io`,
sitemap: `https://leekh8.github.io/sitemap.xml`,
policy: [
{ userAgent: `*`, allow: `/` },
],
},
},
],
};siteUrl์ ๋ฐ๋์ ์ค์ ๋ฐฐํฌ ๋๋ฉ์ธ์ผ๋ก ์ค์ ํด์ผ ํ๋ค. sitemap.xml์ ๋ค์ด๊ฐ๋ URL์ด ์ด ๊ฐ์ ๊ธฐ์ค์ผ๋ก ์์ฑ๋๋ค.
2-3. SEO ์ปดํฌ๋ํธ ๋ง๋ค๊ธฐ
๊ฐ ํ์ด์ง๋ง๋ค ๋ฉํ ํ๊ทธ๋ฅผ ์ผ๊ด์ฑ ์๊ฒ ๊ด๋ฆฌํ๊ธฐ ์ํด SEO ์ปดํฌ๋ํธ๋ฅผ ๋ง๋ ๋ค.
// src/components/SEO.jsx
import React from "react";
import { Helmet } from "react-helmet";
import { useStaticQuery, graphql } from "gatsby";
const SEO = ({ title, description, image, pathname }) => {
const data = useStaticQuery(graphql`
query {
site {
siteMetadata {
title
description
author
siteUrl
}
}
}
`);
const siteMetadata = data.site.siteMetadata;
const metaTitle = title || siteMetadata.title;
const metaDescription = description || siteMetadata.description;
const metaImage = image
? `${siteMetadata.siteUrl}${image}`
: `${siteMetadata.siteUrl}/og-image.png`;
const metaUrl = pathname
? `${siteMetadata.siteUrl}${pathname}`
: siteMetadata.siteUrl;
return (
<Helmet>
{/* ๊ธฐ๋ณธ ๋ฉํ ํ๊ทธ */}
<title>{metaTitle}</title>
<meta name="description" content={metaDescription} />
{/* Open Graph ๋ฉํ ํ๊ทธ (SNS ๊ณต์ ์ฉ) */}
<meta property="og:title" content={metaTitle} />
<meta property="og:description" content={metaDescription} />
<meta property="og:image" content={metaImage} />
<meta property="og:url" content={metaUrl} />
<meta property="og:type" content="website" />
<meta property="og:site_name" content={siteMetadata.title} />
{/* Twitter Card ๋ฉํ ํ๊ทธ */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={metaTitle} />
<meta name="twitter:description" content={metaDescription} />
<meta name="twitter:image" content={metaImage} />
{/* ๊ธฐํ */}
<link rel="canonical" href={metaUrl} />
</Helmet>
);
};
export default SEO;์ด ์ปดํฌ๋ํธ๋ฅผ ๊ฐ ํ์ด์ง ์ปดํฌ๋ํธ์์ ๋ถ๋ฌ์ ์ฌ์ฉํ๋ค.
// ๋ธ๋ก๊ทธ ํฌ์คํธ ํ
ํ๋ฆฟ ์์
const BlogPost = ({ data }) => {
const post = data.markdownRemark;
return (
<>
<SEO
title={post.frontmatter.title}
description={post.frontmatter.description}
pathname={`/posts/${post.fields.slug}`}
/>
<article>
<h1>{post.frontmatter.title}</h1>
<div dangerouslySetInnerHTML={{ __html: post.html }} />
</article>
</>
);
};3. robots.txt ์ค์
3-1. robots.txt๋?
robots.txt๋ ํฌ๋กค๋ฌ(๋ด)์๊ฒ ์ด๋ค ํ์ด์ง๋ฅผ ํฌ๋กค๋งํด๋ ๋๊ณ , ์ด๋ค ํ์ด์ง๋ ํ์ง ๋ง์์ผ ํ๋์ง ์๋ ค์ฃผ๋ ํ์ผ์ด๋ค. ์ฌ์ดํธ ๋ฃจํธ์ ์์นํด์ผ ํ๋ค (https://yourdomain.com/robots.txt).
3-2. robots.txt ๋ฌธ๋ฒ
# ๋ชจ๋ ํฌ๋กค๋ฌ์๊ฒ ๋ชจ๋ ๊ฒฝ๋ก ํ์ฉ
User-agent: *
Allow: /
# Googlebot์๊ฒ๋ง ํน์ ๊ฒฝ๋ก ๋นํ์ฉ
User-agent: Googlebot
Disallow: /private/
# ์ฌ์ดํธ๋งต ์์น ์๋ ค์ฃผ๊ธฐ
Sitemap: https://leekh8.github.io/sitemap.xml| ๋๋ ํฐ๋ธ | ์ค๋ช |
|---|---|
User-agent |
์ด๋ค ๋ด์ ์ ์ฉํ ์ง (*๋ ๋ชจ๋ ๋ด) |
Allow |
์ ๊ทผ ํ์ฉ ๊ฒฝ๋ก |
Disallow |
์ ๊ทผ ๊ธ์ง ๊ฒฝ๋ก |
Sitemap |
์ฌ์ดํธ๋งต ์์น |
3-3. ๊ฐ์ธ ๋ธ๋ก๊ทธ์์ ๊ถ์ฅํ๋ ์ค์
User-agent: *
Allow: /
Sitemap: https://leekh8.github.io/sitemap.xml๊ฐ์ธ ๋ธ๋ก๊ทธ๋ ๋๋ถ๋ถ ๋ชจ๋ ํ์ด์ง๋ฅผ ๋
ธ์ถ์ํค๊ณ ์ถ์ผ๋ฏ๋ก ์ ์ฒด ํ์ฉ์ด ๊ธฐ๋ณธ์ด๋ค. ๊ด๋ฆฌ์ ํ์ด์ง๋ ๋น๊ณต๊ฐ ํ์ด์ง๊ฐ ์๋ค๋ฉด Disallow๋ฅผ ์ถ๊ฐํ๋ค.
3-4. GitHub Pages์์ static ํด๋ ํ์ฉ
gatsby-plugin-robots-txt๋ฅผ ์ฌ์ฉํ๋ฉด ๋น๋ ์ ์๋์ผ๋ก ์์ฑ๋๋ค. ์๋์ผ๋ก ๊ด๋ฆฌํ๋ ค๋ฉด static ํด๋์ ํ์ผ์ ๋ฃ์ผ๋ฉด Gatsby๊ฐ ๋น๋ ์ public ํด๋๋ก ๋ณต์ฌํ๋ค.
ํ๋ก์ ํธ ๊ตฌ์กฐ:
/static/robots.txt โ ๋น๋ ์ /public/robots.txt๋ก ๋ณต์ฌ๋จ/static ํด๋์ ์๋ ํ์ผ์ ๋ณํ ์์ด ๊ทธ๋๋ก public์ผ๋ก ๋ณต์ฌ๋๋ค. HTML ํ์ผ์ ์ด์ฉํ ์์ ๊ถ ์ธ์ฆ ํ์ผ๋ ์ด ๋ฐฉ๋ฒ์ผ๋ก ์ฒ๋ฆฌํ๋ค.
4. sitemap.xml ์์ฑ ๋ฐ ํ์ธ
4-1. sitemap.xml์ด๋?
sitemap.xml์ ์ฌ์ดํธ ๋ด์ ๋ชจ๋ ํ์ด์ง URL ๋ชฉ๋ก์ XML ํ์์ผ๋ก ์ ๊ณตํ๋ ํ์ผ์ด๋ค. ํฌ๋กค๋ฌ๊ฐ ์ด ํ์ผ์ ๋ณด๊ณ ์ด๋ค ํ์ด์ง๊ฐ ์๋์ง ๋น ๋ฅด๊ฒ ํ์
ํ๋ค.
<!-- sitemap.xml ์์ -->
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://leekh8.github.io/</loc>
<lastmod>2024-04-25</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://leekh8.github.io/posts/my-first-post/</loc>
<lastmod>2024-04-20</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>| ํ๊ทธ | ์ค๋ช |
|---|---|
<loc> |
ํ์ด์ง URL (ํ์) |
<lastmod> |
๋ง์ง๋ง ์์ ์ผ |
<changefreq> |
๋ณ๊ฒฝ ๋น๋ (always, hourly, daily, weekly, monthly, yearly, never) |
<priority> |
์ฐ์ ์์ (0.0 ~ 1.0, ๊ธฐ๋ณธ๊ฐ 0.5) |
4-2. gatsby-plugin-sitemap์ผ๋ก ์๋ ์์ฑ
gatsby build ํ public/sitemap.xml ํ์ผ์ด ์์ฑ๋๋ค. ๋ฐฐํฌ ํ https://yourdomain.com/sitemap.xml๋ก ์ ๊ทผํด ํ์ธํ ์ ์๋ค.
4-3. sitemap.xml ์ ํจ์ฑ ๊ฒ์ฌ
์์ฑ๋ sitemap์ด ์ฌ๋ฐ๋ฅธ์ง ํ์ธํ๋ ๋ฐฉ๋ฒ:
- ๋ธ๋ผ์ฐ์ ์์
https://yourdomain.com/sitemap.xml์ง์ ์ด๊ธฐ - XML Sitemap Validator์์ URL ์ ๋ ฅ
- Google Search Console์ Sitemap ์น์ ์ ์ ์ถ ํ ์ค๋ฅ ํ์ธ
5. Google Search Console ๋ฑ๋ก ์ ์ฒด ๊ณผ์
5-1. Google Search Console์ด๋?
Google Search Console(์ดํ GSC)์ ๊ตฌ๊ธ์ด ๋ฌด๋ฃ๋ก ์ ๊ณตํ๋ ๋๊ตฌ๋ค. ๋ด ์ฌ์ดํธ๊ฐ ๊ตฌ๊ธ ๊ฒ์์ ์ด๋ป๊ฒ ๋ ธ์ถ๋๋์ง, ์ด๋ค ํค์๋๋ก ์ ์ ๋๋์ง, ํฌ๋กค๋ง ์ค๋ฅ๋ ์๋์ง ๋ฑ์ ํ์ธํ ์ ์๋ค.
5-2. ์์ฑ ์ ํ ์ ํ
GSC์ ์ฌ์ดํธ๋ฅผ ๋ฑ๋กํ ๋ ๋ ๊ฐ์ง ์์ฑ ์ ํ ์ค ํ๋๋ฅผ ์ ํํ๋ค.
๋๋ฉ์ธ ์์ฑ (Domain property)
- ๋ชจ๋ ์๋ธ๋๋ฉ์ธ๊ณผ ํ๋กํ ์ฝ(http/https)์ ํฌํจํด ํตํฉ ๊ด๋ฆฌ
- DNS TXT ๋ ์ฝ๋๋ฅผ ์ถ๊ฐํ๋ ๋ฐฉ๋ฒ์ผ๋ก๋ง ์ธ์ฆ ๊ฐ๋ฅ
- GitHub Pages๋ GitHub ์ธก์์ DNS๋ฅผ ๊ด๋ฆฌํ๋ฏ๋ก DNS ๋ ์ฝ๋ ์์ ์ด ๋ถ๊ฐ๋ฅ โ ์ฌ์ฉ ๋ถ๊ฐ
URL ์ ๋์ด ์์ฑ (URL-prefix property)
- ํน์ URL ํ์์ ๋ํ ๋ฐ์ดํฐ๋ง ์์ง
- HTML ํ์ผ ์ ๋ก๋, HTML ๋ฉํ ํ๊ทธ ์ฝ์ ๋ฑ ๋ค์ํ ๋ฐฉ๋ฒ์ผ๋ก ์ธ์ฆ ๊ฐ๋ฅ
- GitHub Pages ์ฌ์ฉ์์๊ฒ ์ ํฉํ ๋ฐฉ์
5-3. HTML ํ์ผ ๋ฐฉ์์ผ๋ก ์์ ๊ถ ์ธ์ฆ
- Google Search Console์ ์ ์
- ์์ฑ ์ถ๊ฐ โ "URL ์ ๋์ด" ์ ํ โ ์์ ์ GitHub Pages URL ์
๋ ฅ (์:
https://leekh8.github.io) - "HTML ํ์ผ" ๋ฐฉ๋ฒ ์ ํ โ
googleXXXXXXXXXXXXXXXX.htmlํ์ผ ๋ค์ด๋ก๋ - ๋ค์ด๋ก๋ํ ํ์ผ์ Gatsby ํ๋ก์ ํธ์
/staticํด๋์ ๋ฃ๊ธฐ
project/
โโโ static/
โ โโโ googleXXXXXXXXXXXXXXXX.html โ ์ฌ๊ธฐ์ ๋ฃ๊ธฐ
โโโ src/
โโโ gatsby-config.jsgatsby buildโ GitHub์ ํธ์ โ GitHub Actions ๋ฐฐํฌ ์๋ฃ ํ- GSC๋ก ๋์์ "ํ์ธ" ๋ฒํผ ํด๋ฆญ
staticํด๋์ ํ์ผ์ ๋ฃ์ผ๋ฉด Gatsby ๋น๋ ์publicํด๋๋ก ๊ทธ๋๋ก ๋ณต์ฌ๋๋ค. ๋ฐ๋ผ์ ๋ฐฐํฌ ํhttps://leekh8.github.io/googleXXXXXXXXXXXXXXXX.html๋ก ์ ๊ทผ์ด ๊ฐ๋ฅํด์ง๋ค.
5-4. HTML ๋ฉํ ํ๊ทธ ๋ฐฉ์์ผ๋ก ์์ ๊ถ ์ธ์ฆ
๋ฉํ ํ๊ทธ ๋ฐฉ์์ ํ์ผ์ ๋ฐ๋ก ๋ฐฐํฌํ์ง ์์๋ ๋๋ค. SEO ์ปดํฌ๋ํธ์ ํ๊ทธ ํ๋๋ฅผ ์ถ๊ฐํ๋ฉด ๋๋ค.
// src/components/SEO.jsx ์ ์ถ๊ฐ
<Helmet>
{/* Google Search Console ์์ ๊ถ ์ธ์ฆ ํ๊ทธ */}
<meta name="google-site-verification" content="YOUR_VERIFICATION_CODE" />
{/* ๊ธฐ์กด ๋ฉํ ํ๊ทธ๋ค... */}
</Helmet>๋จ, ์ด ๋ฐฉ๋ฒ์ SEO ์ปดํฌ๋ํธ๊ฐ ๋ชจ๋ ํ์ด์ง์ ๋ ๋๋ง๋๋๋ก ์ค์ ๋ผ ์์ด์ผ ํ๋ค.
5-5. sitemap ์ ์ถ
์์ ๊ถ ์ธ์ฆ ํ, sitemap์ GSC์ ์ ์ถํ๋ฉด ๊ตฌ๊ธ์ด ๋ ๋น ๋ฅด๊ฒ ํ์ด์ง๋ฅผ ๋ฐ๊ฒฌํ ์ ์๋ค.
- GSC ์ข์ธก ๋ฉ๋ด โ "Sitemaps"
- "์ ์ฌ์ดํธ๋งต ์ถ๊ฐ" ์
๋ ฅ๋์
sitemap.xml์ ๋ ฅ - "์ ์ถ" ํด๋ฆญ
์ ์ถ ํ "์ฑ๊ณต"์ผ๋ก ํ์๋๋ฉด ๋๋ค. ์ฒ๋ฆฌ์๋ ๋ช ์๊ฐ์์ ๋ฉฐ์น ์ด ๊ฑธ๋ฆด ์ ์๋ค.
5-6. GSC์์ ํ์ธํ ์ ์๋ ์ ๋ณด
- ์ค์ (Performance): ๊ฒ์ ๋ ธ์ถ ์, ํด๋ฆญ ์, ํ๊ท ์์, CTR
- URL ๊ฒ์ฌ: ํน์ URL์ ์์ธ ์ํ ํ์ธ ๋ฐ ์์ธ ์์ฒญ
- ์์ธ์์ฑ(Index): ์ ์ฒด ํ์ด์ง ์์ธ ์ํ, ์ค๋ฅ ๋ชฉ๋ก
- ๊ฒฝํ(Experience): Core Web Vitals, ๋ชจ๋ฐ์ผ ์ฌ์ฉ์ฑ
- ๋งํฌ: ์ธ๋ถ ๋งํฌ, ๋ด๋ถ ๋งํฌ ํํฉ
6. Naver Webmaster Tools ๋ฑ๋ก ์ ์ฒด ๊ณผ์
6-1. ๋ค์ด๋ฒ ์น๋ง์คํฐ ๋๊ตฌ๋?
๋ค์ด๋ฒ๋ ์์ฒด ๊ฒ์ ์์ง์ ๊ฐ์ง๊ณ ์๋ค. ๊ตญ๋ด ์ฌ์ฉ์๋ฅผ ํ๊ฒ์ผ๋ก ํ๋ค๋ฉด ๋ค์ด๋ฒ ๊ฒ์์๋ ๋ ธ์ถ๋์ด์ผ ํ๋ค. ๋ค์ด๋ฒ ์น๋ง์คํฐ ๋๊ตฌ(searchadvisor.naver.com)์์ ๋ฑ๋กํ๋ค.
6-2. ์ฌ์ดํธ ๋ฑ๋ก ๊ณผ์
- ๋ค์ด๋ฒ ๊ณ์ ์ผ๋ก ๋ก๊ทธ์ธ ํ ์น๋ง์คํฐ ๋๊ตฌ ์ฝ์ ์ ์
- ์ฌ์ดํธ ์ถ๊ฐ โ URL ์
๋ ฅ (์:
https://leekh8.github.io) - ์์ ํ์ธ ๋ฐฉ๋ฒ ์ ํ
HTML ํ์ผ ๋ฐฉ์:
naverXXXXXXXXXXXXXXXX.htmlํ์ผ ๋ค์ด๋ก๋- Gatsby ํ๋ก์ ํธ
/staticํด๋์ ๋ณต์ฌ - ๋น๋ โ ๋ฐฐํฌ โ "์์ ํ์ธ" ํด๋ฆญ
HTML ํ๊ทธ ๋ฐฉ์:
// SEO ์ปดํฌ๋ํธ์ ์ถ๊ฐ
<meta name="naver-site-verification" content="YOUR_NAVER_CODE" />6-3. ๋ค์ด๋ฒ sitemap ์ ์ถ
- ์น๋ง์คํฐ ๋๊ตฌ โ ์์ฒญ โ ์ฌ์ดํธ๋งต ์ ์ถ
https://leekh8.github.io/sitemap.xml์ ๋ ฅ โ ํ์ธ
6-4. RSS ์ ์ถ (์ ํ)
๋ค์ด๋ฒ ์น๋ง์คํฐ ๋๊ตฌ๋ RSS๋ ์ง์ํ๋ค. Gatsby์์ RSS๋ฅผ ์์ฑํ๋ ค๋ฉด gatsby-plugin-feed๋ฅผ ์ถ๊ฐ๋ก ์ค์นํ๋ฉด ๋๋ค.
npm install gatsby-plugin-feed// gatsby-config.js
{
resolve: `gatsby-plugin-feed`,
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark } }) => {
return allMarkdownRemark.nodes.map(node => ({
title: node.frontmatter.title,
description: node.excerpt,
date: node.frontmatter.date,
url: site.siteMetadata.siteUrl + node.fields.slug,
guid: site.siteMetadata.siteUrl + node.fields.slug,
}));
},
query: `
{
allMarkdownRemark(sort: { frontmatter: { date: DESC } }) {
nodes {
excerpt
fields { slug }
frontmatter {
title
date
}
}
}
}
`,
output: `/rss.xml`,
title: `๋ด ๋ธ๋ก๊ทธ RSS`,
},
],
},
},7. Open Graph ๋ฉํ ํ๊ทธ ์ค์
7-1. Open Graph๋?
Open Graph(OG)๋ Facebook์ด ๋ง๋ ํ๋กํ ์ฝ๋ก, ์น ํ์ด์ง๊ฐ ์์ ๋ฏธ๋์ด์์ ๊ณต์ ๋ ๋ ์ด๋ป๊ฒ ํ์๋ ์ง๋ฅผ ์ ์ดํ๋ค. ์นด์นด์คํก, ์ฌ๋, ํธ์ํฐ ๋ฑ ๋๋ถ๋ถ์ ๋ฉ์ ์ ์ SNS๊ฐ OG ํ๊ทธ๋ฅผ ์ง์ํ๋ค.
OG ํ๊ทธ๊ฐ ์์ผ๋ฉด ๊ณต์ ์ URL๋ง ๋์ค๊ฑฐ๋ ์๋ชป๋ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๊ฐ ์์ฑ๋๋ค. OG ํ๊ทธ๊ฐ ์ ์ค์ ๋ผ ์์ผ๋ฉด ์ ๋ชฉ, ์ค๋ช , ๋ํ ์ด๋ฏธ์ง๊ฐ ์์๊ฒ ํ์๋๋ค.
7-2. ํ์ OG ํ๊ทธ
<!-- ํ์ 4๊ฐ -->
<meta property="og:title" content="ํ์ด์ง ์ ๋ชฉ" />
<meta property="og:description" content="ํ์ด์ง ์ค๋ช
" />
<meta property="og:image" content="https://yourdomain.com/og-image.png" />
<meta property="og:url" content="https://yourdomain.com/this-page" />
<!-- ๊ถ์ฅ ์ถ๊ฐ ํ๊ทธ -->
<meta property="og:type" content="article" /> <!-- ๋ธ๋ก๊ทธ ํฌ์คํธ๋ article -->
<meta property="og:site_name" content="๋ด ๋ธ๋ก๊ทธ" />
<meta property="og:locale" content="ko_KR" />7-3. ๋ธ๋ก๊ทธ ํฌ์คํธ์ฉ OG ํ๊ทธ ์ฌํ
// ๋ธ๋ก๊ทธ ํฌ์คํธ SEO ์ปดํฌ๋ํธ
const PostSEO = ({ post }) => (
<Helmet>
<meta property="og:type" content="article" />
<meta property="og:title" content={post.frontmatter.title} />
<meta property="og:description" content={post.frontmatter.description} />
<meta property="article:published_time" content={post.frontmatter.date} />
<meta property="article:modified_time" content={post.frontmatter.update} />
<meta property="article:author" content="leekh8" />
{post.frontmatter.tags.map(tag => (
<meta property="article:tag" content={tag} key={tag} />
))}
</Helmet>
);7-4. OG ์ด๋ฏธ์ง ๊ถ์ฅ ์ฌ์
- ํฌ๊ธฐ: 1200 ร 630px (Facebook ๊ถ์ฅ ์ฌ์ด์ฆ)
- ๋น์จ: 1.91:1
- ํ์ผ ํ์: JPG, PNG
- ํ์ผ ํฌ๊ธฐ: 8MB ์ดํ
- ํ ์คํธ๊ฐ ์ด๋ฏธ์ง ์ค์์ ์์ด์ผ ํจ (๊ฐ์ฅ์๋ฆฌ๋ ์๋ฆด ์ ์์)
7-5. Twitter Card ๋ฉํ ํ๊ทธ
ํธ์ํฐ(ํ X)๋ OG ํ๊ทธ์ ๋ณ๋๋ก ์์ฒด Card ํ์์ ์ฌ์ฉํ๋ค.
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@leekh8" />
<meta name="twitter:title" content="ํ์ด์ง ์ ๋ชฉ" />
<meta name="twitter:description" content="ํ์ด์ง ์ค๋ช
" />
<meta name="twitter:image" content="https://yourdomain.com/og-image.png" />summary_large_image๋ ํฐ ์ด๋ฏธ์ง๋ฅผ ํฌํจํ ์นด๋ ํํ๋ค. summary๋ ์์ ์ธ๋ค์ผ ํํ๋ค.
7-6. OG ํ๊ทธ ํ์ธ ๋๊ตฌ
- Facebook Sharing Debugger: developers.facebook.com/tools/debug
- Twitter Card Validator: cards-dev.twitter.com/validator
- LinkedIn Post Inspector: linkedin.com/post-inspector
- Open Graph Checker: opengraph.xyz
8. ๊ตฌ์กฐํ ๋ฐ์ดํฐ (JSON-LD) ์ค์
8-1. ๊ตฌ์กฐํ ๋ฐ์ดํฐ๋?
๊ตฌ์กฐํ ๋ฐ์ดํฐ(Structured Data)๋ ๊ฒ์ ์์ง์ด ํ์ด์ง ๋ด์ฉ์ ๋ ์ ์ดํดํ ์ ์๋๋ก ํ์คํ๋ ํ์์ผ๋ก ์ ๋ณด๋ฅผ ์ ๊ณตํ๋ ๋ฐฉ๋ฒ์ด๋ค. Schema.org์์ ์ ์ํ ์คํค๋ง๋ฅผ ์ฌ์ฉํ๋ฉฐ, JSON-LD ํ์์ผ๋ก <head> ํ๊ทธ ์์ ์ฝ์
ํ๋ค.
๊ตฌ์กฐํ ๋ฐ์ดํฐ๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ์ค์ ํ๋ฉด ๊ตฌ๊ธ ๊ฒ์ ๊ฒฐ๊ณผ์์ **๋ฆฌ์น ์ค๋ํซ(Rich Snippet)**์ด ๋ํ๋ ์ ์๋ค. ์๋ฅผ ๋ค์ด ๋ ์ํผ ํ์ด์ง๋ผ๋ฉด ์๋ฆฌ ์๊ฐ, ๋ณ์ ์ด ํ์๋๊ณ , ๋ธ๋ก๊ทธ ํฌ์คํธ๋ผ๋ฉด ์์ฑ์์ ๋ ์ง๊ฐ ๊ฐ์กฐ ํ์๋ ์ ์๋ค.
8-2. ๋ธ๋ก๊ทธ ํฌ์คํธ์ฉ JSON-LD
// ๋ธ๋ก๊ทธ ํฌ์คํธ ๊ตฌ์กฐํ ๋ฐ์ดํฐ
const BlogPostSchema = ({ post, siteUrl }) => {
const schema = {
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": post.frontmatter.title,
"description": post.frontmatter.description,
"image": `${siteUrl}/og-image.png`,
"datePublished": post.frontmatter.date,
"dateModified": post.frontmatter.update || post.frontmatter.date,
"author": {
"@type": "Person",
"name": "leekh8",
"url": siteUrl
},
"publisher": {
"@type": "Organization",
"name": "leekh8 ๋ธ๋ก๊ทธ",
"logo": {
"@type": "ImageObject",
"url": `${siteUrl}/logo.png`
}
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": `${siteUrl}${post.fields.slug}`
},
"keywords": post.frontmatter.tags.join(", ")
};
return (
<Helmet>
<script type="application/ld+json">
{JSON.stringify(schema)}
</script>
</Helmet>
);
};8-3. ์น์ฌ์ดํธ ์ ์ฒด ์คํค๋ง
// ์ฌ์ดํธ ์ ์ฒด์ ์ ์ฉํ WebSite ์คํค๋ง
const WebSiteSchema = ({ siteUrl, siteName }) => {
const schema = {
"@context": "https://schema.org",
"@type": "WebSite",
"name": siteName,
"url": siteUrl,
"potentialAction": {
"@type": "SearchAction",
"target": `${siteUrl}/?q={search_term_string}`,
"query-input": "required name=search_term_string"
}
};
return (
<Helmet>
<script type="application/ld+json">
{JSON.stringify(schema)}
</script>
</Helmet>
);
};8-4. ๊ตฌ์กฐํ ๋ฐ์ดํฐ ๊ฒ์ฆ
๊ตฌ์กฐํ ๋ฐ์ดํฐ๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ค์ ๋๋์ง ๊ฒ์ฆํ๋ ๋๊ตฌ:
- Google ๋ฆฌ์น ๊ฒฐ๊ณผ ํ ์คํธ: search.google.com/test/rich-results
- Schema.org ๊ฒ์ฆ๊ธฐ: validator.schema.org
9. Lighthouse SEO ์ ์ ํ์ธ
9-1. Lighthouse๋?
Lighthouse๋ ๊ตฌ๊ธ์ด ๋ง๋ ์คํ์์ค ์ฑ๋ฅ ์ธก์ ๋๊ตฌ๋ค. Chrome ๊ฐ๋ฐ์ ๋๊ตฌ์ ๋ด์ฅ๋ผ ์์ด ๋ณ๋ ์ค์น ์์ด ์ฌ์ฉํ ์ ์๋ค.
๋ค์ ๋ค์ฏ ๊ฐ์ง ํญ๋ชฉ์ ์ธก์ ํ๋ค:
| ํญ๋ชฉ | ์ค๋ช |
|---|---|
| Performance | ํ์ด์ง ๋ก๋ฉ ์๋, Core Web Vitals |
| Accessibility | ์ ๊ทผ์ฑ (๋์ฒด ํ ์คํธ, ์์ ๋๋น ๋ฑ) |
| Best Practices | ๋ณด์, ์ต์ API ์ฌ์ฉ ์ฌ๋ถ |
| SEO | ๊ฒ์ ์์ง ์ต์ ํ ์ค์ |
| PWA | Progressive Web App ์ค์ ์ฌ๋ถ |
9-2. Lighthouse ์คํ ๋ฐฉ๋ฒ
Chrome ๊ฐ๋ฐ์ ๋๊ตฌ ์ฌ์ฉ:
- ๋ถ์ํ๋ ค๋ ํ์ด์ง ์ด๊ธฐ
- F12 (๊ฐ๋ฐ์ ๋๊ตฌ ์ด๊ธฐ)
- "Lighthouse" ํญ ์ ํ
- ๋ถ์ ์นดํ ๊ณ ๋ฆฌ ์ ํ ํ "Analyze page load" ํด๋ฆญ
CLI ์ฌ์ฉ:
npm install -g lighthouse
lighthouse https://leekh8.github.io --output html --output-path ./report.html9-3. SEO ์ ์ ์ฌ๋ฆฌ๋ ์ฒดํฌ๋ฆฌ์คํธ
Lighthouse SEO ๊ฒ์ฌ ํญ๋ชฉ:
<title>ํ๊ทธ ์กด์ฌ ์ฌ๋ถ<meta name="description">ํ๊ทธ ์กด์ฌ ์ฌ๋ถ- ๋ชจ๋ ๋งํฌ์ ์ค๋ช ํ ์คํธ ์กด์ฌ ์ฌ๋ถ
robots.txtํ์ผ ์ ํจ์ฑ- ์ด๋ฏธ์ง์
alt์์ฑ ์กด์ฌ ์ฌ๋ถ - ํ์ด์ง๊ฐ ํฌ๋กค๋ง ๊ฐ๋ฅํ์ง ์ฌ๋ถ
- hreflang ํ๊ทธ (๋ค๊ตญ์ด ์ง์ ์)
- canonical URL ์ค์ ์ฌ๋ถ
100์ ์ ๊ฐ๊น์ธ์๋ก SEO ๊ธฐ์ด๊ฐ ์ ๊ฐ์ถฐ์ง ๊ฒ์ด๋ค.
10. ๊ตฌ๊ธ ๊ฒ์ ๊ฒฐ๊ณผ ๋ ธ์ถ๊น์ง ๊ฑธ๋ฆฌ๋ ์๊ฐ
10-1. ์ธ๋ฑ์ฑ ํ์๋ผ์ธ
GSC์ ์ฌ์ดํธ๋ฅผ ๋ฑ๋กํ๊ณ sitemap์ ์ ์ถํ๋ค๊ณ ํด์ ๋ฐ๋ก ๊ตฌ๊ธ์ ๋ ธ์ถ๋์ง๋ ์๋๋ค. ์ผ๋ฐ์ ์ธ ํ์๋ผ์ธ์ ๋ค์๊ณผ ๊ฐ๋ค.
| ๊ธฐ๊ฐ | ์ํ |
|---|---|
| 1-3์ผ | Googlebot์ด ํฌ๋กค๋ง ์์ |
| 1-2์ฃผ | ์ฃผ์ ํ์ด์ง ์์ธ ์์ |
| 1-3๊ฐ์ | ๊ฒ์ ๊ฒฐ๊ณผ ์์ ์์ ํ |
| 3-6๊ฐ์ | ๊พธ์คํ ๊ฒ์ํ ๊ฒฝ์ฐ ๋ ธ์ถ ์ฆ๊ฐ |
์ ์ฌ์ดํธ๋ "๊ตฌ๊ธ์ด ์ ๋ขฐ๋ฅผ ์๋ ์๊ฐ(Sandbox period)"์ด ํ์ํ๋ค๊ณ ์๋ ค์ ธ ์๋ค. ํนํ ์ฒ์ 3๊ฐ์์ ๋ ธ์ถ์ด ์ ๋๋ผ๋ ๊พธ์คํ ์ฝํ ์ธ ๋ฅผ ์์ฑํ๋ ๊ฒ์ด ์ค์ํ๋ค.
10-2. ์์ธ์ด ์ ๋ ๋ ํ์ธ์ฌํญ
GSC > URL ๊ฒ์ฌ ๋๊ตฌ ํ์ฉ:
- GSC ์ข์ธก ์๋จ ๊ฒ์๋ฐ์ ํ์ธํ๊ณ ์ถ์ URL ์ ๋ ฅ
- "URL์ด Google์ ๋ฑ๋ก๋์ด ์์ง ์์" โ ์์ธ ์ ๋จ
- "์์ธ ์์ฑ ์์ฒญ" ๋ฒํผ ํด๋ฆญ
์์ธ ์์ฒญ ํ ์์ผ ๋ด์ ์ฒ๋ฆฌ๋๋ค. ํ์ง๋ง ์์ฒญ์ด ๊ฒ์ ๊ฒฐ๊ณผ ๋ ธ์ถ์ ๋ณด์ฅํ์ง๋ ์๋๋ค.
์์ฃผ ํ์ธํด์ผ ํ ์์ธ ์คํจ ์์ธ:
robots.txt์์ ํด๋น URL์ ์ฐจ๋จํ๊ณ ์๋ ๊ฒฝ์ฐ<meta name="robots" content="noindex">ํ๊ทธ๊ฐ ์๋ ๊ฒฝ์ฐ- ํ์ด์ง ๋ด์ฉ์ด ๋๋ฌด ์๊ฑฐ๋ ์ค๋ณต ์ฝํ ์ธ ์ธ ๊ฒฝ์ฐ
- ์๋ฒ ์ค๋ฅ(5xx), ๋ฆฌ๋ค์ด๋ ํธ ์ค๋ฅ(3xx)๊ฐ ์๋ ๊ฒฝ์ฐ
- ํ์ด์ง ๋ก๋ฉ ์๋๊ฐ ๋๋ฌด ๋๋ฆฐ ๊ฒฝ์ฐ
11. ์์ธ ์์ฒญ ๋ฐฉ๋ฒ โ URL ๊ฒ์ฌ ๋๊ตฌ ํ์ฉ
11-1. ์ ๊ธ ๋ฐํ ํ ์ฆ์ ์์ธ ์์ฒญ
์ ํฌ์คํธ๋ฅผ ๋ฐํํ๋ฉด Googlebot์ด ๋ฐ๊ฒฌํ๊ธฐ๊น์ง ์๊ฐ์ด ๊ฑธ๋ฆฐ๋ค. GSC์ URL ๊ฒ์ฌ ๋๊ตฌ๋ก ์ง์ ์์ธ์ ์์ฒญํ ์ ์๋ค.
- GSC ์ ์ โ ์๋จ ๊ฒ์๋ฐ์ ์ ํฌ์คํธ URL ์ ๋ ฅ
- "URL์ด Google์ ๋ฑ๋ก๋์ด ์์ง ์์" ๋๋ ํ์ฌ ์์ธ ์ํ ํ์
- "์์ธ ์์ฑ ์์ฒญ" ๋ฒํผ ํด๋ฆญ
- "ํ ์คํธ ๋ผ์ด๋ธ URL" โ ํ์ด์ง๊ฐ ์ ์ ๋ ๋๋ง๋๋์ง ํ์ธ
- "์์ธ ์์ฑ ์์ฒญ" ์ต์ข ํ์ธ
ํ๋ฃจ์ ์์ธ ์์ฒญํ ์ ์๋ ํ์์ ์ ํ์ด ์๋ค. ์ ํํ ์์น๋ ๊ณต๊ฐ๋์ง ์์์ง๋ง ํ๋ฃจ 10-15ํ ์ ๋๊ฐ ์ผ๋ฐ์ ์ผ๋ก ์ธ๊ธ๋๋ค.
11-2. Bing Webmaster Tools๋ ํจ๊ป
๋ง์ดํฌ๋ก์ํํธ Bing๋ ๊ตญ๋ด์์ ์ฌ์ฉ์๊ฐ ์๋ค. Bing Webmaster Tools์๋ ์ฌ์ดํธ๋ฅผ ๋ฑ๋กํด ๋๋ ๊ฒ์ด ์ข๋ค. GSC์ ์ฐ๋ ๊ธฐ๋ฅ์ด ์์ด GSC ๋ฐ์ดํฐ๋ฅผ ๊ทธ๋๋ก ๊ฐ์ ธ์ฌ ์ ์๋ค.
12. ์์ฃผ ํ๋ SEO ์ค์
12-1. <title> ํ๊ทธ ์ค๋ณต
๋ชจ๋ ํ์ด์ง๊ฐ ๋์ผํ <title> ํ๊ทธ๋ฅผ ๊ฐ์ง๋ฉด ๊ตฌ๊ธ์ด ํ์ด์ง๋ฅผ ๊ตฌ๋ถํ์ง ๋ชปํ๋ค. ๊ฐ ํ์ด์ง๋ณ๋ก ๊ณ ์ ํ ์ ๋ชฉ์ ์ค์ ํด์ผ ํ๋ค.
// ์๋ชป๋ ์: ๋ชจ๋ ํ์ด์ง๊ฐ ๊ฐ์ ์ ๋ชฉ
<title>๋ด ๋ธ๋ก๊ทธ</title>
// ์ฌ๋ฐ๋ฅธ ์: ํ์ด์ง๋ณ ๊ณ ์ ์ ๋ชฉ
<title>SQL Basic - 1. ์๊ฐ ๋ฐ ๊ธฐ๋ณธ ๊ฐ๋
| ๋ด ๋ธ๋ก๊ทธ</title>12-2. <meta name="description"> ์๊ฑฐ๋ ์ค๋ณต
description์ด ์์ผ๋ฉด ๊ตฌ๊ธ์ด ์์๋ก ๋ณธ๋ฌธ์์ ๋ฐ์ทํด ํ์ํ๋ค. ์ด ๊ฒฝ์ฐ ๊ฒ์ ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๊ฐ ์ด์ํ๊ฒ ๋ํ๋ ์ ์๋ค. ํ์ด์ง๋ง๋ค ๊ณ ์ ํ description์ ์์ฑํ์.
- ๊ถ์ฅ ๊ธธ์ด: 120-160์ (๋ชจ๋ฐ์ผ ๊ธฐ์ค ~120์)
- ๋๋ฌด ์งง์๋ (50์ ๋ฏธ๋ง), ๋๋ฌด ๊ธธ์ด๋ ์๋ฆด ์ ์์ด ์ข์ง ์๋ค
12-3. ์ด๋ฏธ์ง alt ์์ฑ ๋๋ฝ
<!-- ๋์ ์ -->
<img src="diagram.png" />
<!-- ์ข์ ์ -->
<img src="diagram.png" alt="SQL SELECT ๋ฌธ ์คํ ํ๋ฆ๋" />alt ์์ฑ์ ์ ๊ทผ์ฑ์ ์ํ ๊ฒ์ด๊ธฐ๋ ํ์ง๋ง, ๊ตฌ๊ธ ์ด๋ฏธ์ง ๊ฒ์์์๋ ํ์ฉ๋๋ค.
12-4. noindex ํ๊ทธ ์ค์
๊ฐ๋ฐ ํ๊ฒฝ์์ ์ฌ์ฉํ๋ noindex ํ๊ทธ๋ฅผ ํ๋ก๋์
์ ๊ทธ๋๋ก ์ฌ๋ฆฌ๋ ์ค์๊ฐ ์ข
์ข
๋ฐ์ํ๋ค.
<!-- ์ด ํ๊ทธ๊ฐ ์์ผ๋ฉด ๊ตฌ๊ธ์ด ์์ธํ์ง ์์ -->
<meta name="robots" content="noindex" />GSC์์ ์์ธ์ด ์ ๋๋ค๋ ์ค๋ฅ๊ฐ ๋์ค๋ฉด ์ด ํ๊ทธ๋ฅผ ํ์ธํด ๋ณด์.
12-5. canonical URL ๋ฏธ์ค์
๊ฐ์ ๋ด์ฉ์ด ์ฌ๋ฌ URL๋ก ์ ๊ทผ ๊ฐ๋ฅํ ๋(์: http/https, www ์ ๋ฌด, ํํ ์ฌ๋์ ์ ๋ฌด) ๊ตฌ๊ธ์ด ์ด๋ค URL์ด ๋ํ์ธ์ง ๋ชจ๋ฅผ ์ ์๋ค.
<!-- ๊ฐ ํ์ด์ง์ canonical URL ๋ช
์ -->
<link rel="canonical" href="https://leekh8.github.io/posts/my-post/" />12-6. ํ์ด์ง ์๋ ๋ฌด์
๊ตฌ๊ธ์ ํ์ด์ง ๋ก๋ฉ ์๋๋ฅผ ๋ญํน ์์๋ก ์ฌ์ฉํ๋ค. Gatsby๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์ต์ ํ๊ฐ ์ ๋ผ ์์ง๋ง, ์ธ๋ถ ํฐํธ, ๊ณผ๋ํ ์ด๋ฏธ์ง ๋ฑ์ด ์ฑ๋ฅ์ ๋จ์ด๋จ๋ฆด ์ ์๋ค.
Lighthouse Performance ์ ์๊ฐ 90์ ๋ฏธ๋ง์ด๋ผ๋ฉด ๊ฐ์ ์ด ํ์ํ๋ค. gatsby-plugin-image๋ก ์ด๋ฏธ์ง๋ฅผ ์ต์ ํํ๋ ๊ฒ๋ง์ผ๋ก๋ ์ ์๊ฐ ํฌ๊ฒ ์ค๋ฅผ ์ ์๋ค.
12-7. ๋ชจ๋ฐ์ผ ์ต์ ํ ๋ฏธํก
๊ตฌ๊ธ์ **๋ชจ๋ฐ์ผ ์ฐ์ ์์ธ(Mobile-first Indexing)**์ ์ ์ฉํ๋ค. ์ฆ, ๋ชจ๋ฐ์ผ ๋ฒ์ ์ ์ฝํ ์ธ ๋ฅผ ๊ธฐ์ค์ผ๋ก ์์ธํ๋ค. ๋ฐ์ํ ๋์์ธ์ด ์ ์ฉ๋ผ ์๋์ง ํ์ธํ์.
<!-- viewport ๋ฉํ ํ๊ทธ ํ์ -->
<meta name="viewport" content="width=device-width, initial-scale=1" />๋ง๋ฌด๋ฆฌ
SEO๋ ๋จ๊ธฐ๊ฐ์ ํจ๊ณผ๊ฐ ๋ํ๋์ง ์๋๋ค. ์ค์ ์ ์๋ฃํ ํ ๊พธ์คํ ์ฝํ ์ธ ๋ฅผ ์์ฑํ๋ฉด์ GSC ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ฉฐ ๊ฐ์ ํด ๋๊ฐ๋ ๊ณผ์ ์ด๋ค.
์ฒดํฌ๋ฆฌ์คํธ ์ ๋ฆฌ:
-
gatsby-plugin-sitemap์ค์ ๋ฐ sitemap.xml ์ ์ถ -
gatsby-plugin-robots-txt์ค์ ๋ฐ robots.txt ํ์ธ - ๊ฐ ํ์ด์ง์ ๊ณ ์ ํ
<title>,<meta description>์ค์ - Open Graph ํ๊ทธ ์ค์ (og:title, og:description, og:image, og:url)
- Google Search Console ๋ฑ๋ก ๋ฐ sitemap ์ ์ถ
- Naver Webmaster Tools ๋ฑ๋ก ๋ฐ sitemap ์ ์ถ
- ๊ตฌ์กฐํ ๋ฐ์ดํฐ (JSON-LD) ์ถ๊ฐ
- ์ด๋ฏธ์ง alt ์์ฑ ํ์ธ
- Lighthouse SEO ์ ์ 90์ ์ด์ ๋ฌ์ฑ
- ๋ชจ๋ฐ์ผ ๋ฐ์ํ ํ์ธ
ํ ๋ฒ ์ธํ ํด ๋๋ฉด ์ดํ์๋ ์ข์ ์ฝํ ์ธ ๋ฅผ ๊พธ์คํ ์ฐ๋ ๊ฒ์ด ๊ฐ์ฅ ๊ฐ๋ ฅํ SEO ์ ๋ต์ด๋ค.
