diff --git a/docs/_static/custom.js b/docs/_static/custom.js new file mode 100644 --- /dev/null +++ b/docs/_static/custom.js @@ -0,0 +1,6 @@ +$(document).ready(function () { + // open external link in new browser tab + $('a.external:not([href^="https://docs.softwareheritage.org/"])') + .attr('target', '_blank') + .attr('rel', 'noopener noreferrer'); +}); diff --git a/swh/docs/sphinx/conf.py b/swh/docs/sphinx/conf.py --- a/swh/docs/sphinx/conf.py +++ b/swh/docs/sphinx/conf.py @@ -119,6 +119,8 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] +html_js_files = ["custom.js"] + # make logo actually appear, avoiding gotcha due to alabaster default conf. # https://github.com/bitprophet/alabaster/issues/97#issuecomment-303722935 html_sidebars = {