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

ENH: Added ability to redirect to external pages #246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AakashGfude
Copy link
Member

Added a config variable to specify redirects.

An Example:-

If in lecture-python, _config.yml file

redirects: 
        heavy_tails: 
          "url" : "file:///Users/u6533564/Documents/Office/Quantecon/lecture-python-intro/lectures/_build/html/heavy_tails.html"
          "redirect_text": "This page has been redirected from intro/heavy_tails.html"

Then, the page at heavy_tails in lecture-python will be redirected to the target URL, with information about where it is redirected from and the content in the URL. Like:-
?redirected_from=/Users/u6533564/Documents/Office/Quantecon/lecture-python.myst/lectures/_build/html/heavy_tails.html&content=This page has been redirected from intro/heavy_tails.html

The target page, on detecting the variables in the URL, displays the following admonition:

Screen Shot 2024-03-18 at 12 04 18 am

@AakashGfude AakashGfude requested a review from mmcky March 17, 2024 13:08
Copy link

codecov bot commented Mar 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.07%. Comparing base (e65778b) to head (56fc4d2).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #246      +/-   ##
==========================================
- Coverage   73.18%   73.07%   -0.11%     
==========================================
  Files           2        2              
  Lines         261      260       -1     
==========================================
- Hits          191      190       -1     
  Misses         70       70              
Flag Coverage Δ
pytests 73.07% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mmcky
Copy link
Contributor

mmcky commented Mar 27, 2024

thanks @AakashGfude I will take a closer look at this soon.

So this detects incoming redirect and would display the admonition for any traffic coming from the old location?

@AakashGfude
Copy link
Member Author

So this detects incoming redirect and would display the admonition for any traffic coming from the old location?

Yes, that's right @mmcky.

@github-actions github-actions bot temporarily deployed to commit April 19, 2024 02:15 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants