2026年9月26日土曜日

パンくずリストは<ol>要素で組むのが基本だと思うんですが

パンくずリスト(BreadcrumbList)のマークアップを追加する方法 | Google 検索セントラル  |  Documentation  |  Google for Developers
https://developers.google.com/search/docs/appearance/structured-data/breadcrumb?hl=ja

私がBloggerで使っているものは下の RDFa を使用したものがベースです
(アヒル、黎明鬼等も同じ)

HTML <ol> 順序付きリスト要素 - HTML | MDN
https://developer.mozilla.org/ja/docs/Web/HTML/Reference/Elements/ol

ただ、<ol> は順序付きリスト要素なので position の考え方ですよね
Bloggerのラベルの階層 (position) を別けるのはどうなんだとなるので

リッチリザルト テスト でも警告が出ないのでラベルの position を同じにしても問題ないかと思いますが

<b:loop index='i' values='data:posts.first.labels' var='label'>
<!-- b:if cond='data:label.isLast == &quot;true&quot;' -->
<li class='breadcrumb-item' property='itemListElement' typeof='ListItem'><a expr:href='data:label.url' property='item' typeof='WebPage'><span property='name'><data:label.name/></span></a>
<meta expr:content='data:i + 2' property='position'/></li>
<!-- /b:if -->
</b:loop>

ラベル順に position を付けるやり方はこうですね

マークアップ通りだとやっぱ順番にした方がいいかな

F(uriouz)

欲しいものリスト / 優先度の高いほしいものリスト / ☕を奢る
Donate 寄付 カンパ サポート Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.
詳細プロフィールを表示

0 comments:

スパム対策の為コメントをオフにしています。
Disqusは利用出来ます。

注: コメントを投稿できるのは、このブログのメンバーだけです。

...

Recent Posts

 
"The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License."