Skip to content

Breadcrumbs for custom pages #177

Open
@sharangj

Description

Problem

Any publisher using quintype-node-seo should be able to construct custom breadcrumbs for a page. The breadcrumbs are restricted to story-page and section-page for now. Refer this.

Proposal

We need to introduce another option which is passed from the load-data function of the publisher using quintype-node-seo.

For example, If a publisher returns a new variable called breadcrumbs in load-data:

  return {
    collection: collectionAsJson,
    cacheKeys: collection ? collection.cacheKeys(config["publisher-id"]) : null,
    title: "page title",
    breadcrumbs: [{name: "Custom Page", url: "http://example.com/custom-page"}]
  }

generateBreadcrumbListData should be able to consume the breadcrumb key passed in the data parameter and it should return the breadcrumb list by doing something like this breadcrumbsDataList.concat(data.breadcrumbs). This can be the breadcrumbs for that particular page irrespective of whether page is passed or not.

Acceptance Criteria

  • Please write tests in the corresponding test file.
  • Please make sure the documentation is updated here.
  • Breadcrumbs are tested with structured data testing tool

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions