Skip to content

Commit 87f9190

Browse files
committed
adding awesome colors!
Signed-off-by: Vanessa Sochat <[email protected]>
1 parent afb9cac commit 87f9190

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

_includes/footer.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,6 @@
4242

4343
</footer>
4444
<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>
5645
{% assign slashes = page.url | split: "/" %}
5746
<script>console.log('{{ slashes | size }}')</script>
5847
<script>app.initialize({version:"0.17.4", url:{base:'{{ site.baseurl }}'}})</script>

_includes/headers.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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>

_includes/toc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Select each header
1212
sections = $('#md-container-pancakes h1');
13-
$.each(sections, function( idx, v ) {
13+
$.each(sections, function(idx, v) {
1414
section = $(v);
1515
var div_id = $(section).attr('id');
1616
var div_text = section.text();

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
</main>
1717
</div>
1818
{% include footer.html %}
19+
{% include headers.html %}
1920
{% include tags.html %}
2021
{% include scrolltop.html %}
2122
</body>

0 commit comments

Comments
 (0)