Skip to content

The structured data items may contain fields that do not comply with Google's guidelines, which can negatively impact SEO. #9319

@TingJianZheng

Description

@TingJianZheng

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

image

node_modules/@docusaurus/theme-classic/lib/theme/DocBreadcrumbs/index.js
Why is an href required here to add a ListItem? It seems like there might be some issues with this approach. (For objects of type "BreadcrumbList," schemas such as schema.org don't recognize "position" as a valid property.)

reference file: https://developers.google.com/search/docs/appearance/structured-data/breadcrumb#structured-data-type-definitions
image

Reproducible demo

No response

Steps to reproduce

, In the SidebarsConfig, whenever an element's type is "Category" and it doesn't need to include the href attribute, you may encounter this issue of structured data inconsistency.
image

Expected behavior

I believe there's no need to determine whether it's part of the breadcrumb navigation based on the presence of href here, as this is already within the breadcrumb navigation itself.

Actual behavior

image image `node_modules/@docusaurus/theme-classic/lib/theme/DocBreadcrumbs/index.js `

The href is an optional attribute, but it is used to determine whether it is a part of the breadcrumb.


image

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions