facebook / facebook/docusaurus

Add breadcrumb for blog posts

Open
#8,635 11 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
66.2k
Forks
10k
Avg merge
1d 3h
Merged PRs (30d)
52

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.