ドキュメントの meta description を修正(TDD実践)#1797
Merged
Merged
Conversation
## TDD アプローチ 1. RED: meta description の品質を確認するテストを追加 2. GREEN: 問題のあるファイルを修正してテストを通す 3. REFACTOR: (不要) ## テスト追加 `spec/models/document_spec.rb` に新しいテストを追加: - すべての公開ドキュメントの meta description に HTML タグが含まれていないことを確認 - 問題のあるファイルを具体的に報告 ## 修正したファイル ### regional-license.md - <div> ラッパーを削除し、<img> タグを1行に統一 - meta description 用の説明文を追加:「CoderDojo Foundation と一般社団法人 CoderDojo Japan の間で締結された地域ライセンス契約書です。2016年の契約当時の写しとなります。」 ### regional-license_en.md - <div> ラッパーを削除し、<img> タグを1行に統一 - meta description 用の説明文を追加:「Regional license agreement between CoderDojo Foundation and CoderDojo Japan Association, dated August 27th, 2016.」 ### post-backend-update-history.md - meta description 用の説明文を追加:「2016年の CoderDojo Advent Calendar で公開した、coderdojo.jp のバックエンド刷新に関する技術記事です。」 ## 効果 SNS シェア時に適切な meta description が表示され、 HTML タグではなく意味のある説明文が表示されるようになりました。 ## テスト結果 ``` bundle exec rspec spec/models/document_spec.rb 8 examples, 0 failures ```
- 言語切り替えリンクを blockquote の後に移動し、より自然な配置に - 区切り線を追加して、説明部分と契約本文を明確に分離 - 説明文を簡潔化:「現在は改訂されている可能性がある点にご注意ください」→「2016年の設立当時の写しとなります」 - regional-license との表記を統一
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
TDD(Test-Driven Development)を実践し、公開ドキュメントの meta description に HTML タグが含まれている問題を修正しました。
TDD アプローチ
🔴 RED
すべての公開ドキュメントの meta description を検証するテストを追加し、問題のあるファイルを検出:
regional-license.mdregional-license_en.mdpost-backend-update-history.md🟢 GREEN
検出された問題を修正し、テストが通ることを確認:
<div>ラッパーを削除し、<img>タグを1行に統一🔵 REFACTOR
表記と構造を改善:
変更内容
テスト追加(
spec/models/document_spec.rb)修正したファイル
1.
regional-license.md<img>タグが description に(HTMLタグとして認識)2.
regional-license_en.md<img>タグが description に(HTMLタグとして認識)3.
post-backend-update-history.md4.
teikan.mdテスト結果
bundle exec rspec spec/models/document_spec.rb 8 examples, 0 failures ✅効果
スクリーンショット
meta description の例:
関連 PR