File tree Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 42
42
43
43
</ footer >
44
44
< script src ="{{ site.baseurl }}/assets/js/application.js "> </ script >
45
- < script >
46
- $ ( ".pancakes-parent" ) . on ( 'click' , function ( ) {
47
- console . log ( $ ( this ) . next ( ) ) ;
48
- $ ( this ) . next ( ) . find ( '.pancakes-child' ) . toggle ( ) ;
49
- if ( $ ( this ) . hasClass ( 'open-parent' ) ) {
50
- $ ( this ) . removeClass ( 'open-parent' ) ;
51
- } else {
52
- $ ( this ) . addClass ( 'open-parent' ) ;
53
- }
54
- } )
55
- </ script >
56
45
{% assign slashes = page.url | split: "/" %}
57
46
< script > console . log ( '{{ slashes | size }}' ) </ script >
58
47
< script > app . initialize ( { version :"0.17.4" , url :{ base :'{{ site.baseurl }}' } } ) </ script >
Original file line number Diff line number Diff line change
1
+ < script >
2
+ var headers = [ "h1" , "h2" , "h3" , "h4" ]
3
+ var colors = [ "red" , "orange" , "green" , "blue" ]
4
+
5
+ $ . each ( headers , function ( i , header ) {
6
+ var color = colors [ i ] ;
7
+ $ ( header ) . each ( function ( ) {
8
+ var href = $ ( this ) . attr ( "id" ) ;
9
+ $ ( this ) . append ( '<a class="headerlink" style="color:' + color + '" href="#' + href + '" title="Permanent link">¶</a>' )
10
+ } ) ;
11
+ } )
12
+
13
+ // Ensure that sidebar on left has arrows
14
+ $ ( ".pancakes-parent" ) . on ( 'click' , function ( ) {
15
+ console . log ( $ ( this ) . next ( ) ) ;
16
+ $ ( this ) . next ( ) . find ( '.pancakes-child' ) . toggle ( ) ;
17
+ if ( $ ( this ) . hasClass ( 'open-parent' ) ) {
18
+ $ ( this ) . removeClass ( 'open-parent' ) ;
19
+ } else {
20
+ $ ( this ) . addClass ( 'open-parent' ) ;
21
+ }
22
+ } )
23
+ </ script >
Original file line number Diff line number Diff line change 10
10
11
11
// Select each header
12
12
sections = $ ( '#md-container-pancakes h1' ) ;
13
- $ . each ( sections , function ( idx , v ) {
13
+ $ . each ( sections , function ( idx , v ) {
14
14
section = $ ( v ) ;
15
15
var div_id = $ ( section ) . attr ( 'id' ) ;
16
16
var div_text = section . text ( ) ;
Original file line number Diff line number Diff line change 16
16
</ main >
17
17
</ div >
18
18
{% include footer.html %}
19
+ {% include headers.html %}
19
20
{% include tags.html %}
20
21
{% include scrolltop.html %}
21
22
</ body >
You can’t perform that action at this time.
0 commit comments