Skip to content

Commit ff635e3

Browse files
srenatusSeanTAllen
authored andcommitted
mkdocs: auto-scroll to current section (ponylang#1155)
Irregardless of which section was viewed, the navbar would be displayed _scrolled to the top_. With this, it will scroll to the currently viewed section.
1 parent e56075d commit ff635e3

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

.docs/extra.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// https://github.com/mkdocs/mkdocs/issues/803
2+
$(document).ready(() => $('.wy-nav-side').scrollTop($('li.toctree-l1.current').offset().top - $('.wy-nav-side').offset().top - 80));

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ after_success:
155155
build/release/ponyc packages/stdlib --docs;
156156
cd stdlib-docs;
157157
sudo -H pip install mkdocs;
158+
cp ../.docs/extra.js docs/;
158159
sed -i '' 's/site_name:\ stdlib/site_name:\ Pony Standard Library/' mkdocs.yml;
159160
mkdocs gh-deploy -v --clean --remote-name gh-token;
160161
fi;

0 commit comments

Comments
 (0)