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

use javascript to open new tab for external links #5159

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ install-conda-lock:

.PHONY: conda-lock
conda-lock: install-conda-lock
conda-lock -f monodocs-environment.yaml --without-cuda --lockfile monodocs-environment.lock.yaml
conda-lock -f monodocs-environment.yaml --without-cuda \
--lockfile monodocs-environment.lock.yaml \
--platform=osx-64 --platform=osx-arm64 --platform=linux-64

.PHONY: stats
stats:
Expand Down
11 changes: 11 additions & 0 deletions docs/_static/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Add event listener for DOMContentLoaded event
window.addEventListener("DOMContentLoaded", function() {
// Select all <a> elements with class "external"
var externalLinks = document.querySelectorAll("a.external");

// Loop through each <a> element with class "external"
externalLinks.forEach(function(link) {
// Set the target attribute to "_blank"
link.setAttribute("target", "_blank");
});
});
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
# custom extensions
"auto_examples",
"import_projects",
"sphinx_new_tab_link"
]

source_suffix = {
Expand Down Expand Up @@ -188,6 +187,7 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = ["custom.css", "flyte.css", "algolia.css"]
html_js_files = ["custom.js"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down
Loading
Loading