Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
add client redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
vabarbosa committed Apr 12, 2023
1 parent 56445ab commit 1b3bd13
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/create_redirections.py
Expand Up @@ -5,6 +5,7 @@

import os
import sys
import json

overwrite_option = '--overwrite'

Expand All @@ -22,7 +23,10 @@ def create_redirection (buildpath, old, new, overwrite=False):
Creates a HTML redirection.
'''
redirectionpath = os.path.join(buildpath, old)
redirectioncontent = f'<head><meta http-equiv="Refresh" content="0; URL={new}"></head>'
redirectioncontent = f"""<html>
<head><meta http-equiv="refresh" content="0; URL={new}"></head>
<body><p>This page has moved to <a href="{new}">.</p></body>
</html>"""
if os.path.exists(redirectionpath) and not overwrite:
print(f'File `{redirectionpath}` already exists. Pass {overwrite_option} to force overwritting.')
return
Expand All @@ -40,5 +44,7 @@ def create_redirection (buildpath, old, new, overwrite=False):

overwrite = sys.argv[1] == overwrite_option
base_dir = sys.argv[1] if not overwrite else sys.argv[2]
for (old, new) in REDIRECTIONS.items():

LEARN_REDIRECTIONS= json.load(open('learn_redirections.json', 'r'))
for (old, new) in LEARN_REDIRECTIONS.items():
create_redirection(base_dir, old, new, overwrite=overwrite)
80 changes: 80 additions & 0 deletions scripts/learn_redirections.json
@@ -0,0 +1,80 @@
{
"preface.html": "https://qiskit.org/learn",
"ch-prerequisites/linear_algebra.html": "https://learn.qiskit.org/course/ch-appendix/an-introduction-to-linear-algebra-for-quantum-computing",
"ch-algorithms/deutsch-josza.html": "https://learn.qiskit.org/course/ch-algorithms/deutsch-jozsa-algorithm",
"ch-quantum-hardware/calibrating-qubits-openpulse.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/calibrating-qubits-using-qiskit-pulse",
"what-is-quantum.html": "https://learn.qiskit.org/course/introduction/why-quantum-computing",
"ch-prerequisites/setting-the-environment.html": "https://learn.qiskit.org/course/ch-prerequisites/environment-setup-guide-to-work-with-qiskit-textbook",
"ch-prerequisites/python-and-jupyter-notebooks.html": "https://learn.qiskit.org/course/ch-prerequisites/introduction-to-python-and-jupyter-notebooks",
"ch-states/introduction.html": "https://learn.qiskit.org/course/ch-states/introduction",
"ch-states/atoms-computation.html": "https://learn.qiskit.org/course/ch-states/the-atoms-of-computation",
"ch-states/representing-qubit-states.html": "https://learn.qiskit.org/course/ch-states/representing-qubit-states",
"ch-states/single-qubit-gates.html": "https://learn.qiskit.org/course/ch-states/single-qubit-gates",
"ch-states/case-for-quantum.html": "https://learn.qiskit.org/course/ch-states/the-case-for-quantum-computers",
"ch-gates/introduction.html": "https://learn.qiskit.org/course/ch-gates/introduction",
"ch-gates/multiple-qubits-entangled-states.html": "https://learn.qiskit.org/course/ch-gates/multiple-qubits-and-entangled-states",
"ch-gates/phase-kickback.html": "https://learn.qiskit.org/course/ch-gates/phase-kickback",
"ch-gates/more-circuit-identities.html": "https://learn.qiskit.org/course/ch-gates/basic-circuit-identities",
"ch-gates/proving-universality.html": "https://learn.qiskit.org/course/ch-gates/proving-universality",
"ch-gates/oracles.html": "https://learn.qiskit.org/course/ch-gates/classical-computation-on-a-quantum-computer",
"ch-algorithms/index.html": "https://learn.qiskit.org/course/ch-algorithms",
"ch-algorithms/defining-quantum-circuits.html": "https://learn.qiskit.org/course/ch-algorithms/quantum-circuits",
"ch-algorithms/deutsch-jozsa.html": "https://learn.qiskit.org/course/ch-algorithms/deutsch-jozsa-algorithm",
"ch-algorithms/bernstein-vazirani.html": "https://learn.qiskit.org/course/ch-algorithms/bernstein-vazirani-algorithm",
"ch-algorithms/simon.html": "https://learn.qiskit.org/course/ch-algorithms/simons-algorithm",
"ch-algorithms/quantum-fourier-transform.html": "https://learn.qiskit.org/course/ch-algorithms/quantum-fourier-transform",
"ch-algorithms/quantum-phase-estimation.html": "https://learn.qiskit.org/course/ch-algorithms/quantum-phase-estimation",
"ch-algorithms/shor.html": "https://learn.qiskit.org/course/ch-algorithms/shors-algorithm",
"ch-algorithms/grover.html": "https://learn.qiskit.org/course/ch-algorithms/grovers-algorithm",
"ch-algorithms/quantum-counting.html": "https://learn.qiskit.org/course/ch-algorithms/quantum-counting",
"ch-algorithms/quantum-walk-search-algorithm.html": "https://learn.qiskit.org/course/ch-algorithms/quantum-walk-search-algorithm",
"ch-algorithms/teleportation.html": "https://learn.qiskit.org/course/ch-algorithms/quantum-teleportation",
"ch-algorithms/superdense-coding.html": "https://learn.qiskit.org/course/ch-algorithms/superdense-coding",
"ch-algorithms/quantum-key-distribution.html": "https://learn.qiskit.org/course/ch-algorithms/quantum-key-distribution",
"ch-applications/algs_for_apps_index.html": "https://learn.qiskit.org/course/ch-applications",
"ch-applications/apps_index.html": "https://learn.qiskit.org/course/ch-applications",
"ch-applications/hhl_tutorial.html": "https://learn.qiskit.org/course/ch-applications/solving-linear-systems-of-equations-using-hhl-and-its-qiskit-implementation",
"ch-applications/vqe-molecules.html": "https://learn.qiskit.org/course/ch-applications/simulating-molecules-using-vqe",
"ch-applications/qaoa.html": "https://learn.qiskit.org/course/ch-applications/solving-combinatorial-optimization-problems-using-qaoa",
"ch-applications/satisfiability-grover.html": "https://learn.qiskit.org/course/ch-applications/solving-satisfiability-problems-using-grovers-algorithm",
"ch-machine-learning/machine-learning-qiskit-pytorch.html": "https://learn.qiskit.org/course/ch-applications/hybrid-quantum-classical-neural-networks-with-pytorch-and-qiskit",
"ch-applications/imp_index.html": "https://learn.qiskit.org/course/ch-applications",
"ch-paper-implementations/vqls.html": "https://learn.qiskit.org/course/ch-applications/the-variational-quantum-linear-solver",
"ch-applications/image-processing-frqi-neqr.html": "https://learn.qiskit.org/course/ch-applications/flexible-representation-of-quantum-images-frqi",
"ch-applications/quantum-edge-detection.html": "https://learn.qiskit.org/course/ch-applications/quantum-edge-detection",
"ch-paper-implementations/tsp.html": "https://learn.qiskit.org/course/ch-applications/tsp",
"ch-quantum-hardware/index-circuits.html": "https://learn.qiskit.org/course/quantum-hardware",
"ch-quantum-hardware/error-correction-repetition-code.html": "https://learn.qiskit.org/course/quantum-hardware/introduction-to-quantum-error-correction-via-the-repetition-code",
"ch-quantum-hardware/measurement-error-mitigation.html": "https://learn.qiskit.org/course/quantum-hardware/measurement-error-mitigation",
"ch-quantum-hardware/randomized-benchmarking.html": "https://learn.qiskit.org/course/quantum-hardware/randomized-benchmarking",
"ch-quantum-hardware/measuring-quantum-volume.html": "https://learn.qiskit.org/course/quantum-hardware/measuring-quantum-volume",
"ch-quantum-hardware/density-matrix.html": "https://learn.qiskit.org/course/quantum-hardware/density-matrix",
"ch-quantum-hardware/index-pulses.html": "https://learn.qiskit.org/course/quantum-hardware-pulses",
"ch-quantum-hardware/calibrating-qubits-pulse.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/calibrating-qubits-using-qiskit-pulse",
"ch-quantum-hardware/accessing_higher_energy_states.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/accessing-higher-energy-states-with-qiskit-pulse",
"ch-quantum-hardware/transmon-physics.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/introduction-to-transmon-physics",
"ch-quantum-hardware/cQED-JC-SW.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/circuit-quantum-electrodynamics",
"ch-quantum-hardware/Jaynes-Cummings-model.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/exploring-the-jaynes-cummings-hamiltonian-with-qiskit-pulse",
"ch-quantum-hardware/ac-Stark-shift.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/measuring-the-qubit-ac-stark-shift",
"ch-quantum-hardware/hamiltonian-tomography.html": "https://learn.qiskit.org/course/quantum-hardware-pulses/hamiltonian-tomography",
"ch-labs/index.html": "https://learn.qiskit.org/course/ch-labs",
"ch-labs/Lab01_QuantumCircuits.html": "https://learn.qiskit.org/course/ch-labs/lab-1-quantum-circuits",
"ch-labs/Lab02_QuantumMeasurement.html": "https://learn.qiskit.org/course/ch-labs/lab-2-single-qubit-gates",
"ch-labs/Lab03_AccuracyQPE.html": "https://learn.qiskit.org/course/ch-labs/lab-3-quantum-measurements",
"ch-labs/Lab04_IterativePhaseEstimation.html": "https://learn.qiskit.org/course/ch-labs/lab-4-bell-ghz-circuit",
"ch-labs/Lab05_Scalable_Shor_Algorithm.html": "https://learn.qiskit.org/course/ch-labs/lab-5-accuracy-of-quantum-phase-estimation",
"ch-labs/Lab06_Grover_search_with_an_unknown_number_of_solutions.html": "https://learn.qiskit.org/course/ch-labs/lab-6-iterative-phase-estimation-algorithm",
"ch-labs/Lab07_QuantumSimulationSearchAlgorithm.html": "https://learn.qiskit.org/course/ch-labs/lab-7-scalable-shors-algorithm",
"ch-labs/Lab08_QEC.html": "https://learn.qiskit.org/course/ch-labs/lab-8-grovers-search-with-an-unknown-number-of-solutions",
"ch-appendix/index.html": "https://learn.qiskit.org/course/ch-appendix",
"ch-appendix/linear_algebra.html": "https://learn.qiskit.org/course/ch-appendix/an-introduction-to-linear-algebra-for-quantum-computing",
"ch-appendix/qiskit.html": "https://learn.qiskit.org/course/ch-appendix/basic-qiskit-syntax",
"ch-demos/index.html": "https://learn.qiskit.org/course/ch-demos",
"ch-ex/hello-qiskit.html": "https://learn.qiskit.org/course/ch-demos/hello-qiskit",
"ch-demos/bonus-level-sandbox.html": "https://learn.qiskit.org/course/ch-demos/hello-qiskit",
"ch-demos/piday-code.html": "https://learn.qiskit.org/course/ch-demos/estimating-pi-using-quantum-phase-estimation-algorithm",
"ch-demos/chsh.html": "https://learn.qiskit.org/course/ch-demos/local-reality-and-the-chsh-inequality",
"ch-demos/coin-game.html": "https://learn.qiskit.org/course/ch-demos/coin-game",
"ch-demos/variational-quantum-regression.html": "https://learn.qiskit.org/course/ch-demos/variational-quantum-regression",
"widgets-index.html": "https://qiskit.org/learn"
}

0 comments on commit 1b3bd13

Please sign in to comment.