포스트

gitblog 구글 서칭하게 만들기

Google Search Console로 접속하기

https://search.google.com/search-console/about 에 접속한다.

스크린샷 2022-05-21 오후 4 50 44

gitblog가 존재할 경우 URL 접두어 부분에 gitblog 사이트 입력을 해준다.

스크린샷 2022-05-21 오후 4 29 18

html 파일을 다운로드 후에 root의 동일한 위치에 파일을 위치해준다.

sitemap.xml 생성하기

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
32
---
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>{{ site.url }}{{ 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>

sitemap.xml 을 생성후에 아까와 동일하게 root의 위치와 동일하게 위치해준다.

robots.txt 생성하기

1
2
3
4
User-agent: *
Allow: /

Sitemap: URL/sitemap.xml

URL 에 자신의 URL을 입력해주고 robots.txt root의 위치와 동일하게 위치해준다.

Google Search에 sitemap 설정해주기

스크린샷 2022-05-21 오후 5 04 33

새 사이트 맵에 sitemap.xml 을 추가해준다.

현재 사진과 같이 가져올수 없음이라고 뜨는데.. 오래걸릴수도 있다고한다. 결과가 나오면 다시 포스팅 수정할것임

참고

https://ip99202.github.io/posts/깃허브-블로그-구글-검색-가능하게-하기/

https://velog.io/@eona1301/Github-Blog-검색창-노출시키기

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.