I am using the Hugo Learn Theme: Learn Theme for Hugo :: Documentation for Hugo Learn Theme
Is there a built in/easy way to have the Left nav scroll to current page? I frequently will click around the same sections, and it’s a bit tedious having to scroll back to find what part of my site I am navigating within.
Rob
I recommend you raise an issue with the theme author: https://github.com/matcornic/hugo-theme-learn/issues
This seems to do the trick. I put it in my layouts/partials/custom-footer.html
layouts/partials/custom-footer.html
<script> $(document).ready(function () { document.getElementsByClassName('ps-container')[0].scrollTop = document.getElementsByClassName('active')[0].offsetTop; }); </script>
You could use my Relearn fork
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.