Issue When Submitting Sitemap to Search Console #
sitemap.xml Registration Failure #
Even after submitting a sitemap request, it hasn’t been registered for several days. I’m not sure if the issue is with GitHub Pages or Hugo, so I need to check each step one by one.
Sitemap Generation #
Hugo provides a built-in sitemap generator, so no additional work is usually needed. Still, I created a custom sitemap just in case, though I’m not sure if it’s the correct approach.
{{- printf "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!-- 홈 -->
<url>
<loc>{{ .Site.BaseURL | safeURL }}</loc>
<lastmod>{{ with .Site.Home.Lastmod }}{{ .UTC.Format "2006-01-02T15:04:05Z07:00" }}{{ else }}{{ now.UTC.Format "2006-01-02T15:04:05Z07:00" }}{{ end }}</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<!-- 정규 페이지들 (draft, private 제외) -->
{{- range where .Site.RegularPages "Draft" "ne" true -}}
{{- if not .Params.private }}
<url>
<loc>{{ .Permalink | safeURL }}</loc>
<lastmod>{{ with .Lastmod }}{{ .UTC.Format "2006-01-02T15:04:05Z07:00" }}{{ else }}{{ now.UTC.Format "2006-01-02T15:04:05Z07:00" }}{{ end }}</lastmod>
<changefreq>{{ with .Params.sitemap_changefreq }}{{ . }}{{ else }}weekly{{ end }}</changefreq>
<priority>{{ with .Params.sitemap_priority }}{{ . }}{{ else }}0.5{{ end }}</priority>
</url>
{{- end }}
{{- end }}
</urlset>
Checking Googlebot Access #
Use the command below to verify whether Googlebot can access the sitemap.xml file.
curl -A "Googlebot" -I https://mcjoi.github.io/sitemap.xml
result
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 7764
Server: GitHub.com
Content-Type: application/xml
No specific settings were made in robots.txt. #
User-agent: *
Allow: /
Sitemap: https://mcjoi.github.io/sitemap.xml
Issue Investigation Failed #
Since I couldn’t figure out the cause, all I can do is wait.