extend blog prevItem
/nextItem
metadata
#9140
Labels
feature
This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Have you read the Contributing Guidelines on issues?
Description
Extend the metadata that is passed to blog paginator buttons.
Has this been requested on Canny?
Not that I'm aware of.
Motivation
As part of my custom blog implementation, I would like to add more context to the paginator buttons for blogs. These includes, but is not limited to
authors
anddate
.API design
Considering that the stock UI of the paginator buttons only requires
title
andpermalink
, I think it would make sense to allow developers to extend the metadata of each blog using a generator function. This way, a developer can choose the props they need and then swizzle the paginator component to update the UI.I'm not that familiar with the docusaurus codebase, but I assume another factor to keep in mind is to find a solution that generalizes nicely to the docs plugin too?
An alternative solution, that I've already implemented is to extend the metadata directly in the plugin internals, which would give developers the flexibility to do more structural changes when swizzling.
Have you tried building it?
I've made a minimal fork that updates loadContent() from
docusaurus-plugin-content-blog
to pass additional metadata toprevItem/nextItem
props.Again, this is just a quick POC and I'm open to solutions that handle the problem in a more generic way.
Self-service
The text was updated successfully, but these errors were encountered: