Skip to content

Commit

Permalink
docs(head.swig):fix the document page anchor position offset. (#790)
Browse files Browse the repository at this point in the history
When the document page is opened by an anchor, the top position of the page is offset.
Use jquery to fix the problem in the docs template.
  • Loading branch information
binsee authored and popomore committed Apr 25, 2017
1 parent 9ef9d6a commit 1132779
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/themes/egg/layout/partial/head.swig
Expand Up @@ -5,4 +5,4 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/images/favicon.png" type="image/x-icon">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
{{ css('css/index') }}
{{ css('css/index') }}
20 changes: 19 additions & 1 deletion docs/themes/egg/source/css/page/page.less
Expand Up @@ -31,4 +31,22 @@
.page-main article {
min-height: 400px;
padding:50px 50px 50px 270px;
}

h2, h3, h4, h5, h6 {
position: static;
a.markdown-anchor {
position: relative;
height: 25px;
margin-right: -25px;
display: inline-block;
}

&:before {
content: '';
display: block;
margin-top: -76px;
height: 76px;
visibility: hidden;
}
}
}

0 comments on commit 1132779

Please sign in to comment.