Skip to content
This repository was archived by the owner on Aug 19, 2023. It is now read-only.
This repository was archived by the owner on Aug 19, 2023. It is now read-only.

Move Aer redirects to Cloudflare #1738

@Eric-Arellano

Description

@Eric-Arellano

Right now, we are using the extension sphinx_redirects to redirect the old Aer docs to the new style. (Note that this before the Ecosystem migration):

def _redirects_for_aer() -> Dict[str, str]:
"""Set up URL redirects for Aer.
We've gone through two migrations with Aer:
1) From `qiskit.org/documentation/stubs/qiskit.providers.aer` to
`qiskit.org/documentation/stubs/qiskit_aer`.
2) From `qiskit.org/documentation/stubs/qiskit_aer` to
`qiskit.org/documentation/aer/stubs/qiskit_aer`.
"""
result = {}
original_sources = (Path(__file__).parent / "aer_sources.txt").read_text()
for original_provider_html_file_path in original_sources.splitlines():
qiskit_aer_html_file_path = original_provider_html_file_path.replace(
"qiskit.providers.aer", "qiskit_aer"
)
new_url = (
"https://qiskit.org/documentation/aer"
if ".extensions." in original_provider_html_file_path
else f"https://qiskit.org/documentation/aer/{qiskit_aer_html_file_path}"
)
result.update(
{
original_provider_html_file_path: new_url,
qiskit_aer_html_file_path: new_url,
}
)
return result

But sphinx_redirects does not properly set its Sphinx config if it can be parallelized. So it causes -j auto to fail, which makes the docs build much slower. That will be an issue when we migrate the metapackage docs to Terra.

Instead, Matthew T. had the simpler idea to move these redirects into the Cloudflare config for qiskit.org. That is already how we did the ecosystem/ redirects.

Metadata

Metadata

Assignees

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