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

plugin-client-redirects: Support external URLs #9651

Closed
1 of 2 tasks
matevz opened this issue Dec 20, 2023 · 1 comment
Closed
1 of 2 tasks

plugin-client-redirects: Support external URLs #9651

matevz opened this issue Dec 20, 2023 · 1 comment
Labels
closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@matevz
Copy link

matevz commented Dec 20, 2023

Have you read the Contributing Guidelines on issues?

Description

We migrated a chapter describing the API from a plain markdown file into the project's source code API code comments. Then, we generated the API reference pages with the Solidity doc generator and host them on another domain (api.docs.oasis.io versus docs.oasis.io).

But, for backward compatibility, we always redirect any removed/renamed pages to a new URL using https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-client-redirects. To make the redirect work in our case, we would need to use something like this:

        {
            to: 'https://api.docs.oasis.io/sol/sapphire-contracts/',
            from: '/dapp/sapphire/precompiles',
        },

, but this yields

[ERROR] ValidationError: "redirects[44].to" is not a valid pathname. Pathname should start with slash and not contain any domain or query string.

It would be nice to have support for redirecting to external websites. For now, we just use a placeholder file with "This chapter has beem moved to..." content.

Has this been requested on Canny?

No response

Motivation

See above.

API design

No response

Have you tried building it?

No response

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.
@matevz matevz 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 Dec 20, 2023
@matevz matevz changed the title docusaurus-plugin-redirect: Support external URLs plugin-client-redirects: Support external URLs Dec 20, 2023
@slorber
Copy link
Collaborator

slorber commented Dec 21, 2023

Please respect our issue template, mention the docusaurus version used and always try on the latest version.

3.0 supports this: #9171

@slorber slorber closed this as completed Dec 21, 2023
@slorber slorber added closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way. and removed status: needs triage This issue has not been triaged by maintainers labels Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

2 participants