Skip to content
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

Add pageBasePath to blog plugin configuration #9828

Closed
2 tasks done
ilg-ul opened this issue Feb 6, 2024 · 3 comments · Fixed by #9838
Closed
2 tasks done

Add pageBasePath to blog plugin configuration #9828

ilg-ul opened this issue Feb 6, 2024 · 3 comments · Fixed by #9838
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@ilg-ul
Copy link
Contributor

ilg-ul commented Feb 6, 2024

Have you read the Contributing Guidelines on issues?

Description

Allow to configure the URL part for multi-page lists, currently hard coded as page.

Has this been requested on Canny?

No response

Motivation

In Docusaurus, the URL parts used to compose the paths are configurable via options like routeBasePath, tagsBasePath, etc, but in the path used for multi-page lists, a part of the URL is hard-coded as page.

This feature can be useful for example when all paths are translated to local languages.

API design

To control this new feature add a pageBasePath option.

Have you tried building it?

The functionality is implemented in cronica-it@be48705.

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.
@ilg-ul ilg-ul added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Feb 6, 2024
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Feb 8, 2024
@slorber
Copy link
Collaborator

slorber commented Feb 8, 2024

👍 looks like a good option to add


This feature can be useful for example when all paths are translated to local languages.

Not sure what you mean here, but we don't particularly recommend to localize paths/slugs.

https://docusaurus.io/docs/i18n/introduction#i18n-non-goals

If your site supports multiple locales, localizing urls will cause problems when switching from one locale to another.

@ilg-ul
Copy link
Contributor Author

ilg-ul commented Feb 8, 2024

My chronology site is Romanian only, and paths are localised, only page was in English, that's why I needed this patch.

BTW, don't get me wrong, all my other projects and sites are English only, the chronology site was an exception and I had some difficulties to localise it, since I've never done similar things before.

@ilg-ul
Copy link
Contributor Author

ilg-ul commented Feb 8, 2024

Since this probably the simplest proposal, I submitted a first PR, trying to learn the process.

I'll need some help to understand how this feature can be tested. A link to a similar test would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants