Implement the following plan: SEO改善プラン — Meow Programming Language サイト Context サイト…
- User
Implement the following plan:
SEO改善プラン — Meow Programming Language サイト
Context
サイト
https://135yshr.github.io/meow/が検索エンジンでトップに表示されない。調査の結果、以下の重大な問題が見つかった。
発見された問題
致命的 (Critical)
-
public/がlocalhost:1313のURLで生成されているsitemap.xml、OGタグ、全てのURLがhttp://localhost:1313/meow/を指している- 原因:
public/がローカル開発サーバーで生成され、そのままコミットされている - CI(
hugo.yml)では--baseURLで正しいURLを使っているが、コミット済みのpublic/は開発用 - 対策:
public/をgitignoreに追加(CIで毎回生成されるため不要)
-
robots.txtにSitemapのURLが記載されていない- 現在:
User-agent: *のみ - 対策: Hugo設定で
robots.txtテンプレートを追加しSitemap:ディレクティブを含める
- 現在:
-
構造化データ(JSON-LD)が完全に欠如
- Schema.org の
SoftwareApplication/WebSite/Organization情報なし - Google検索結果でリッチスニペットが表示されない
- 対策: JSON-LD テンプレートを追加
- Schema.org の
重要 (High)
-
canonical URL が未設定
- 重複コンテンツと判定されるリスク
- 対策:
baseof.htmlの<head>に<link rel="canonical">を追加
-
Sitemapの優先度が全ページ一律
0.5- ホームページや主要コンテンツの優先度が低すぎる
- 対策: Hugo のカスタム sitemap テンプレートでページ種別ごとに優先度を設定
-
homeの outputs に["HTML"]のみ指定 → RSS/Sitemap が除外hugo.tomlの[outputs] home = ["HTML"]により、トップレベルの RSS と sitemap がホームから生成されない可能性- 対策:
home = ["HTML", "RSS", "SITEMAP"]に変更(Hugo はデフォルトでこれらを含むが、明示的にオーバーライドされている)
中程度 (Medium)
-
_index.mdの front matter に description がない(トップページ)- は設定されているが、コンテンツファイル側にない
-
Assistant
プランに沿って SEO 改善を実装します。まず現在のファイル状態を確認します。
Assistant
.gitignoreは既にpublic/を含んでいますね。git で追跡されているか確認します。Assistant
public/は追跡されていません。では全変更を実装します。Assistant
次に新規ファイルを作成します。
Assistant
全ファイル作成完了。Hugo でビルドして検証します。
Assistant
ビルド成功。生成物を検証します。
Assistant
全て正しく生成されています。sitemapにホームページが含まれているか確認します。
Assistant
ホームページがsitemapに含まれていないようです。Hugo の
.Data.Pagesはホームページ自体を含まないことがあります。テンプレートを修正します。Assistant
Hugo のデフォルト sitemap テンプレートは
where .Data.Pagesを使いますが、ホームページが含まれない場合は.Site.AllPagesを使う必要があるかもしれません。確認のため再ビルドして別のアプローチを検討します。Assistant
やはりホームページが含まれていません。Hugo の sitemap テンプレートの
.Data.Pagesはホームページを除外します。.Site.RegularPagesも同様です。ホームページを手動で追加します。Assistant
全ての検証が通りました。変更内容をまとめます:
変更したファイル (4件):
website/hugo.toml— outputs に RSS/SITEMAP 追加、sitemap priority を -1 にwebsite/content/_index.md— description 追加website/layouts/_default/baseof.html— canonical URL、JSON-LD partial、GA4 初期化修正
新規作成したファイル (3件): 4.
website/layouts/partials/jsonld.html— WebSite/SoftwareApplication/Article の JSON-LD 構造化データ 5.website/layouts/robots.txt— Sitemap ディレクティブ付きカスタムテンプレート 6.website/layouts/_default/sitemap.xml— ページ種別ごとの priority 設定(ホーム: 1.0、セクション: 0.8、コンテンツ: 0.6)検証結果:
robots.txt:Sitemap: https://135yshr.github.io/meow/sitemap.xmlを含むsitemap.xml: ホームページ (priority 1.0) を含む全ページが正しい URL で生成index.html: canonical URL、JSON-LD (WebSite + SoftwareApplication)、正しい description、GA4 のdataLayer/gtag初期化を確認
- User
検証方法
cd website && hugo --gc --minifyでビルド- 生成された
public/sitemap.xmlのURLがhttps://135yshr.github.io/meow/であることを確認 - 生成された
public/robots.txtにSitemap:が含まれることを確認 - 生成された
public/index.htmlに以下が含まれることを確認:<link rel="canonical"><script type="application/ld+json">- 正しい meta description
- 各ページの
<head>にcanonical URLがあることを確認 - Google Rich Results Test で JSON-LD を検証
hugo serverでローカル確認 → リンク切れや表示崩れがないこと
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/135yshr/.claude/projects/-Users-135yshr-go-src-github-com-135yshr-meow/2d720405-127c-417e-9bf9-e96ba6bb2c5f.jsonl
If this plan can be broken down into multiple independent tasks, consider using the TeamCreate tool to create a team and parallelize the work.
- User
修正ファイルと変更内容
1.
website/hugo.toml— outputs修正 + sitemap設定[outputs] home = ["HTML", "RSS", "SITEMAP"]に変更- sitemap の priority をデフォルト -1(カスタムテンプレートで制御)
2.
website/.gitignore— public/ を無視public/を追加(CIで毎回ビルドされるため)
3.
website/layouts/_default/baseof.html— canonical URL + JSON-LD<link rel="canonical" href="{{ .Permalink }}">を追加- JSON-LD 構造化データ partial を追加
4.
website/layouts/partials/jsonld.html— 新規作成- ホームページ:
WebSite+SoftwareApplicationスキーマ - 記事ページ:
Articleスキーマ(各コンテンツページ用)
5.
website/layouts/robots.txt— カスタムテンプレートSitemap: {{ .Site.BaseURL }}sitemap.xmlを含める- Hugo は
enableRobotsTXT = true+ テンプレートがあればテンプレートを使用
6.
website/layouts/_default/sitemap.xml— カスタムsitemap- ホームページ: priority 1.0
- セクションページ: priority 0.8
- コンテンツページ: priority 0.6
7.
website/content/_index.md— description追加- front matter に
descriptionを追加
- User
発見された問題
致命的 (Critical)
-
public/がlocalhost:1313のURLで生成されているsitemap.xml、OGタグ、全てのURLがhttp://localhost:1313/meow/を指している- 原因:
public/がローカル開発サーバーで生成され、そのままコミットされている - CI(
hugo.yml)では--baseURLで正しいURLを使っているが、コミット済みのpublic/は開発用 - 対策:
public/をgitignoreに追加(CIで毎回生成されるため不要)
-
robots.txtにSitemapのURLが記載されていない- 現在:
User-agent: *のみ - 対策: Hugo設定で
robots.txtテンプレートを追加しSitemap:ディレクティブを含める
- 現在:
-
構造化データ(JSON-LD)が完全に欠如
- Schema.org の
SoftwareApplication/WebSite/ 情報なし
- Schema.org の
-
- User
create pr
Assistant
PR を作成しました: https://github.com/135yshr/meow/pull/70