facebook / facebook/docusaurus

Add breadcrumb for blog posts

オープン
#8,635 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る
feature
主要言語
TypeScript
スター
66.2k
フォーク
10k
平均マージ
1日 3時間
マージ済み PR(30日)
52

説明

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Description

Add 2 breadcrumbs to blogs functionality; so blogs would have breadcrumbs in the same way docs have breadcrumbs:

- Blog archive page
- [BLOG ROOT URL] -> Archive
- Any blog post page
- [BLOG ROOT URL] -> Archive -> [BLOG POST]

### Has this been requested on Canny?

Yes: https://docusaurus.io/feature-requests/p/add-breadcrumb-for-blog-posts

### Motivation

I've been on a bit of a mission to improve my Docusaurus blogs SEO. The agency I'm working with suggested adding breadcrumb Structured Data. I've done that implement an invisible breadcrumb using JSON-LD here:

https://johnnyreilly.com/docusaurus-blogs-adding-breadcrumb-structured-data

I'm happy with what I've done, but I'm wondering if it might make sense for Docusaurus to have a breadcrumb in place for blog posts by default. Given that docs already have a breadcrumb (and one that surfaces Structured Data), I'm wondering if it might be useful if blog to as well?

If the answer if "yes", the follow on question becomes: what breadcrumb makes sense? In my head, this makes sense (and it's what I've implemented for my blog):

[BLOG ROOT URL] -> Archive -> [BLOG POST]

### API design

I'm unsure what level of configuration would make sense here. Perhaps as simple as having a `breadcrumbEnabled: boolean` option that defaults to `true` to allow people to opt out.

It seems likely that we could reuse the existing breadcrumb mechanism (I've had a quick look at the code and it seemed potentially shareable.)

What do you think?

### Have you tried building it?

No

### Self-service

- [X] I'd be willing to contribute this feature to Docusaurus myself.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。