ギャラリー「記事のメタ情報」の見本に文字数・閲覧数を足す (#3129) - #3157
Merged
Merged
Conversation
見本の .blog-info が日付・著者の2項目しか出ておらず、直下の説明文 「日付・著者・文字数・閲覧数を1行に並べ」と食い違っていた (#3129)。 文字数・PV の <li> は article.ejs にしか無かったので _partial/post/metrics.ejs へ抜き出し、article.ejs とgallery.ejs の 両方から呼ぶ形にした。二重に持つと、article.ejs 側の文言や構造が 変わったときに見本だけ古いまま残る。 見本の記事は最新の1本を選ぶ作りだったが、直近数日の記事は GA4 の 集計がまだ無くPVが0件のため、選び直しても閲覧数の行が出ない。 サムネ・タグに加えてPV>0も条件にして、実データのまま4項目そろう 記事を選ぶようにした。 Co-Authored-By: Claude <noreply@anthropic.com>
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.
ギャラリーの「記事のメタ情報」の見本が日付・著者の2項目しか出しておらず、説明文の「日付・著者・文字数・閲覧数を1行に並べ」と食い違っていたのを、記事ページと同じ4項目にします。実体側が正(#3129)。
やったこと
_partial/post/metrics.ejsに切り出し、記事ページ(_partial/article.ejs)とギャラリーの見本が同じ partial を呼ぶ形にしました。「見本は本物の partial を呼ぶ。作り直した見本は腐るので置かない」の原則どおり、見本専用の markup は作っていませんscripts/ui_gallery.js)。直近の記事は GA4 の集計がまだ無いことが多く、従来の「最新でサムネとタグ3つを持つ記事」だと PV の項目が欠けた見本になるため、PV > 0 まで条件に足して最新から遡ります検証
.blog-infoがどちらも同じ4項目(2026.08.27 / 澁川喜規 / 約 5,000 文字 / 2,000 View)indexの伝播を生成 HTML で確認)Closes #3129
🤖 Generated with Claude Code