Move heading anchors 50px up to avoid nav bar

Fixes #447.

We do this by moving the actual anchored element up in the page without moving the actual text. (Apple uses a similar trick in their framed docs.) Now this looks a bit sillier on smaller screens but it's better overall.
This commit is contained in:
Ben Alpert
2013-11-04 17:21:16 -08:00
committed by Paul O’Shannessy
parent 92ce80cf4f
commit b21cdac9e3
2 changed files with 15 additions and 7 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class Redcarpet::Render::HTML
.gsub(/\s+/, "-")
.gsub(/[^A-Za-z0-9\-_.]/, "")
return "<h#{level} id=\"#{clean_title}\"><a href=\"##{clean_title}\">#{title}</a></h#{level}>"
return "<h#{level} id=\"#{clean_title}\" class=\"anchor\"><a href=\"##{clean_title}\">#{title}</a></h#{level}>"
end
end