diff --git a/docs/source/conf.py b/docs/source/conf.py index b1c6238..eeef8ae 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,8 +19,14 @@ extensions = [ "myst_parser", "sphinx_copybutton", + 'sphinx_favicon', ] +favicons = [ + "https://kedro.org/images/favicon.ico", +] + + templates_path = ["_templates"] exclude_patterns = [ diff --git a/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html b/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html index 40a7109..a836e60 100644 --- a/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html +++ b/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html @@ -13,9 +13,9 @@
- Kedro - Kedro-Viz - Kedro-Datasets + Kedro + Kedro-Viz + Kedro-Datasets
{%- include "searchbox.html" %} @@ -65,6 +65,38 @@ openBtn.dataset.toggle = 'wy-nav-top'; openBtn.classList.add('wy-nav-top-open'); document.querySelector('.wy-nav-top').prepend(openBtn); + + // Select all navigation links within the .wy-main-nav container + var navLinks = document.querySelectorAll('.wy-main-nav .wy-main-nav-link'); + + // Define paths to check against the current URL + var paths = ['kedro-viz', 'kedro-datasets']; + var currentPath = window.location.pathname; + + // Function to remove 'active' class from all links + function removeActiveClass() { + navLinks.forEach(function(link) { + link.classList.remove('active'); + }); + } + + + // Check each path for a match with the current URL + paths.forEach(function(path) { + if (currentPath.includes(path)) { + navLinks.forEach(function(link) { + if (link.getAttribute('href').includes(path)) { + removeActiveClass(); // Ensure only one link is active + link.classList.add('active'); // Add 'active' class to the matching link + } + }); + } + }); }); {% endblock %} + + +https://docs.kedro.org/en/stable/ +https://docs.kedro.org/projects/kedro-viz/en/stable/ +https://docs.kedro.org/projects/kedro-datasets/en/stable/ \ No newline at end of file