Merge pull request #79 from asolove/72-auto-anchor

Add anchors around all headers in the content.
This commit is contained in:
Mathieu David 2015-12-28 16:29:55 +01:00
commit f9b6e09c26
3 changed files with 14 additions and 5 deletions

View File

@ -315,7 +315,7 @@ h3 {
.light .mobile-nav-chapters { .light .mobile-nav-chapters {
background-color: #fafafa; background-color: #fafafa;
} }
.light .content a { .light .content a:link {
color: #4183c4; color: #4183c4;
} }
.light .theme-popup { .light .theme-popup {
@ -371,7 +371,7 @@ h3 {
.coal .mobile-nav-chapters { .coal .mobile-nav-chapters {
background-color: #292c2f; background-color: #292c2f;
} }
.coal .content a { .coal .content a:link {
color: #2b79a2; color: #2b79a2;
} }
.coal .theme-popup { .coal .theme-popup {
@ -427,7 +427,7 @@ h3 {
.navy .mobile-nav-chapters { .navy .mobile-nav-chapters {
background-color: #282d3f; background-color: #282d3f;
} }
.navy .content a { .navy .content a:link {
color: #2b79a2; color: #2b79a2;
} }
.navy .theme-popup { .navy .theme-popup {
@ -483,7 +483,7 @@ h3 {
.rust .mobile-nav-chapters { .rust .mobile-nav-chapters {
background-color: #3b2e2a; background-color: #3b2e2a;
} }
.rust .content a { .rust .content a:link {
color: #2b79a2; color: #2b79a2;
} }
.rust .theme-popup { .rust .theme-popup {

View File

@ -28,6 +28,15 @@ $( document ).ready(function() {
var html = $("html"); var html = $("html");
var sidebar = $("#sidebar"); var sidebar = $("#sidebar");
var page_wrapper = $("#page-wrapper"); var page_wrapper = $("#page-wrapper");
var content = $("#content");
// Add anchors for all content headers
content.find("h1, h2, h3, h4, h5").wrap(function(){
var wrapper = $("<a>");
wrapper.attr("name", $(this).text());
return wrapper;
});
// Toggle sidebar // Toggle sidebar

View File

@ -51,7 +51,7 @@
background-color: $sidebar-bg background-color: $sidebar-bg
} }
.content a { .content a:link {
color: $links color: $links
} }