mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Added basic scrollspy
This commit is contained in:
@@ -10,7 +10,7 @@ pages:
|
||||
- ['topics/django-extra-views-compatibility.md', 'Topics / Django Extra Views Compatilibity']
|
||||
- ['topics/release-notes.md', 'Topics / Release Notes']
|
||||
|
||||
theme_dir: 'united'
|
||||
theme_dir: 'theme'
|
||||
source_dir: 'docs'
|
||||
output_dir: 'build'
|
||||
|
||||
|
||||
@@ -91,6 +91,10 @@ def build_html(config):
|
||||
content = md.convert(source_content)
|
||||
meta = md.Meta
|
||||
|
||||
# Allow 'template:' override in md source files.
|
||||
if 'template' in meta:
|
||||
template = env.get_template(meta['template'][0])
|
||||
|
||||
# Strip out the generated table of contents
|
||||
(content, toc) = content.split('<!-- STARTTOC -->', 1)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body onload="prettyPrint()">
|
||||
<body>
|
||||
|
||||
{% include "nav.html" %}
|
||||
<div class="container">
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/* Prettyify */
|
||||
$( document ).ready(function() {
|
||||
prettyPrint();
|
||||
});
|
||||
|
||||
/* Scrollspy */
|
||||
var navHeight = $('.navbar').outerHeight(true) + 10
|
||||
|
||||
$('body').scrollspy({
|
||||
target: '.bs-sidebar',
|
||||
offset: navHeight
|
||||
})
|
||||
|
||||
/* We need to adjust the scroll height of anchor links to adjust for the
|
||||
fixed height navbar */
|
||||
window.disableShift = false;
|
||||
|
||||
Reference in New Issue
Block a user