Skip to content

Commit 9fd8553

Browse files
committed
Make room for a table of contents
1 parent b101bda commit 9fd8553

File tree

5 files changed

+54
-2
lines changed

5 files changed

+54
-2
lines changed

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<script src="/js/jquery.defaultvalue.js?body=1" type="text/javascript"></script>
4848
<script src="/js/session.min.js?body=1" type="text/javascript"></script>
4949
<script src="/js/site.js?body=1" type="text/javascript"></script>
50+
<script src="/js/toc.js?body=1" type="text/javascript"></script>
5051
</div>
5152
</body>
5253
</html>
53-

_layouts/toc.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
layout: default
3+
---
4+
<div id="toc">
5+
<ul><li>Item one</li></ul>
6+
</div>
7+
8+
<div id="primary">
9+
{{ content }}
10+
</div>

css/libgit2.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,3 +1986,20 @@ th, td {
19861986
img {
19871987
max-width: 100%;
19881988
}
1989+
1990+
/* Table of contents */
1991+
1992+
#primary {
1993+
width: 750px;
1994+
}
1995+
1996+
#toc {
1997+
width: 190px;
1998+
float: right;
1999+
background-color: #fff;
2000+
-webkit-border-radius: 3px;
2001+
-moz-border-radius: 3px;
2002+
-ms-border-radius: 3px;
2003+
-o-border-radius: 3px;
2004+
border-radius: 3px;
2005+
}

docs/guides/101-samples/index.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
---
2-
layout: default
2+
layout: toc
33
---
44

55
# 101 Libgit2 Samples
6+
7+
## Diff
8+
9+
### One
10+
11+
### Two
12+
13+
### Three
14+
15+
16+
17+
## Walking History
18+
19+
### Won
20+
21+
### Two
22+
23+
### Free

js/toc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$(window).scroll(function(){
2+
$("#toc")
3+
.stop()
4+
.animate({"marginTop": ($(window).scrollTop()) + "px",
5+
"marginLeft":($(window).scrollLeft()) + "px"},
6+
"fast");
7+
});

0 commit comments

Comments
 (0)