Skip to content

Commit

Permalink
remove custom js
Browse files Browse the repository at this point in the history
Signed-off-by: Huong Nguyen <huongg1409@gmail>
  • Loading branch information
Huong Nguyen committed Jun 25, 2024
1 parent 08d5dd4 commit 9c25649
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 32 deletions.
25 changes: 0 additions & 25 deletions docs/source/_static/custom.js

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
"https://kedro.org/images/favicon.ico",
]

# Add the relative path from your conf.py file to the assets directory to html_static_path
html_static_path = ['_static']

# Include custom.js in the HTML output
html_js_files = [
'custom.js',
]

templates_path = ["_templates"]

Expand Down
24 changes: 24 additions & 0 deletions src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,30 @@
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');

// Function to remove 'active' class from all links
function removeActiveClass() {
navLinks.forEach(function(link) {
link.classList.remove('active');
});
}

// Add click event listener to each link
navLinks.forEach(function(link) {
link.addEventListener('click', function(event) {
// Prevent the default link action
event.preventDefault();

// Remove 'active' class from all links
removeActiveClass();

// Add 'active' class to the clicked link
event.target.classList.add('active');
});
});
});
</script>
{% endblock %}

0 comments on commit 9c25649

Please sign in to comment.