File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ find _site/tutorials _site/usage _site/developers -name "index.html" 2>/dev/null
15
15
if [ -f " $ipynb_file " ]; then
16
16
# Check if link is already present
17
17
if ! grep -q ' Download notebook' " $html_file " ; then
18
- # Add as a new <li> item in the toc-actions <ul>
19
- # This appears alongside "Edit this page" and "Report an issue"
20
- # We need to add it to BOTH occurrences (sidebar and mobile footer)
21
- perl -i -pe ' s/(<div class="toc-actions"><ul> )/$1<li><a href="index.ipynb" class="toc-action" download><i class="bi bi-journal-code"><\/i>Download notebook<\/a><\/li>/g' " $html_file "
18
+ # Insert the notebook link AFTER the "Report an issue" link
19
+ # This ensures it goes in the right place in the sidebar toc-actions
20
+ # The download="index.ipynb" attribute forces browser to download instead of navigate
21
+ perl -i -pe ' s/(<a href="[^"]*issues\/new"[^>]*><i class="bi[^"]*"><\/i>Report an issue<\/a><\/li> )/$1<li><a href="index.ipynb" class="toc-action" download="index.ipynb" ><i class="bi bi-journal-code"><\/i>Download notebook<\/a><\/li>/g' " $html_file "
22
22
echo " ✓ Added notebook link to $html_file "
23
23
fi
24
24
fi
You can’t perform that action at this time.
0 commit comments