Closed Dolphin-PC closed 3 weeks ago
SEO 83점
검색엔진에게 제출할 웹사이트의 보고서
라고 생각하면 된다.
우리 사이트에 이런 페이지가 있어요~
이 사이트맵을 통해 검색엔진은 웹사이트를 방문하여 크롤링하는 과정에서, 모든 페이지를 빠짐없이 색인할 수 있도록 돕는 역할을 한다.
많은 블로그들에서 react-router-sitemap 라이브러리를 활용해 만들곤 한다.
sitemap이란 결국 .xml파일
로 작성하는 것 뿐인데, 호환도 잘 안되는 라이브러리랑 힘겨루기 하는 것도 싫었고, 결국 router에 있는 객체를 읽어서 .xml문자열로 만드는 것이다.
그렇기에, 나는 라이브러리를 설치하지 않고 쌩 js파일을 만들어
xml파일
을 작성하는 것으로 했다.
발견되지 않을 수도 있는 점을 미연에 방지
한다는 점밖에는 없다.
사이드프로젝트에서는 별 필요가 없을 거 같다...
9점 상승
User-agent: *
Sitemap: http://localhost:5173/sitemap.xml
<img width="563" alt="image" src="https://github.com/user-attachments/assets/c902a99d-26dd-48ac-8966-1dc615f946d7">