-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Older/newer posts label in blog plugin should be configurable #7250
Comments
Please either use swizzle or translations to do this. See https://docusaurus.io/docs/next/swizzling#do-i-need-to-swizzle |
@Josh-Cena The actual problem is that I am using two blogs in parallel on one site. In the actual blog I want to keep it as it is, yet in the other I need to have it translated. Would it be possible to configure it this way ootb? |
Errr... So, it's kinda complicated. We actually also have a blog purposed as release notes on our site: https://docusaurus.io/changelog However, it's heavily customized, and we've "swizzled" pretty much every component of the blog plugin. The best way is to create a separate I'm not sure if we necessarily want to offer another option just to customize the text label, provided this is a super niche use-case. |
I get the point. Maybe making your own change-log a re-usable plugin would be a cool feature? To be honest this is the first thing I was looking for. Thank you for the quick feedback! |
We've seen quite a few people re-purposing the blog plugin for other stuff, like wikis or digital gardens. We'd like to collect more use-cases, and maybe make dedicated content plugins for each. For now, anything outside of blogging itself is unlikely to get first-class support (which I think you can understand). As for exposing our own changelog plugin—maybe not a bad idea! We can think about it after the v2 release. Right now, it's mostly a hack. |
You can try this conditional logic after swizzling the component: import useRouteContext from '@docusaurus/useRouteContext';
export default function BlogListPaginator(props: Props): JSX.Element {
const isReleaseNotes = useRouteContext().plugin.id === "release-notes"
return (
isReleaseNotes ?
<Translate
id="MY_ID">
MY_CUSTOM_MESSAGE
</Translate>
:
<Translate
id="theme.blog.paginator.olderEntries"
description="The label used to navigate to the older blog posts page (next page)">
Older Entries
</Translate>
);
}
You can also use |
Thank you for the hints! Probably at the moment the most sensible and safe solution will be to translate it permanently to something more general like Next/Previous. |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Older/newer posts label in blog plugin should be configurable. If you want to use the blog engine to post other content (like release notes), the term 'post' becomes irrelevant in this context.
Reproducible demo
No response
Steps to reproduce
Expected behavior
Configuration option (as described in https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog) should be possible.
Actual behavior
Not configurable.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: