GIT 블로그 seo 설정

업데이트:

SEO

Search Engine Optimization
검색 엔진(google, naver …etc)이 내 사이트를 분석하기 쉽게 정보를 제공함으로써, 포털 사이트에 내 페이지들을 노출하는 것이 목적이다.

robots.xml 등록

검색 엔진(robot)이 내 사이트에서 수집해도 되는 리소스 목록을 등록한다.

1
2
3
User-agent: *
Allow: /
Sitemap: https://wichan7.github.io/sitemap.xml

sitemap.xml 등록

사이트맵은 내가 사이트에서 중요하다고 생각하는 페이지와 파일을 검색엔진 알릴 수 있다.
jekyll은 {% %} {{}}와 같은 variable template를 제공하므로, 내 posts들을 동적으로 sitemap에 등록해보자.
(참조: https://jekyllrb-ko.github.io/docs/variables/)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
layout: null
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  {% for post in site.posts %}
    <url>
      <loc>https://wichan7.github.io{{ post.url }}</loc>
      {% if post.lastmod == null %}
        <lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
      {% else %}
        <lastmod>{{ post.lastmod | date_to_xmlschema }}</lastmod>
      {% endif %}

      {% if post.sitemap.changefreq == null %}
        <changefreq>weekly</changefreq>
      {% else %}
        <changefreq>{{ post.sitemap.changefreq }}</changefreq>
      {% endif %}

      {% if post.sitemap.priority == null %}
          <priority>0.5</priority>
      {% else %}
        <priority>{{ post.sitemap.priority }}</priority>
      {% endif %}

    </url>
  {% endfor %}
</urlset>

https://search.google.com/search-console
google search에 내 site를 등록해보자.
제공받은 html 파일을 내 / 경로에 등록하고, google search가 탐색 가능하다면, 등록은 완료다.

페이지 등록

  1. URL 접두어를 선택
  2. 내 git blog url 삽입 (https://wichan7.github.io)
  3. html 파일 다운로드
  4. / 경로에 html 파일 등록

sitemap 등록

  1. 우측 Sitemaps에서 sitemap 등록

댓글남기기