Skip to content

Commit 2ee9961

Browse files
committed
IVY-450 highlight current page in menu
1 parent b49c51e commit 2ee9961

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

asciidoc/style/style.css

+1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ table.tableblock .valign-middle {
324324
list-style-type: none;
325325
padding-left: 22px;
326326
margin-bottom: 3px;
327+
color: #7a9438;
327328
}
328329
.treeview li.submenu {
329330
background: white url('data:image/svg+xml;utf-8,<svg version="1.1" width="16px" height="16px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><polygon points="2,2 14,2 8,14" fill="%237a9438"/></svg>') no-repeat left 1px;

asciidoc/templates/document.html.slim

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
2828
link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"
2929
script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js" type="text/javascript"
3030
javascript:
31-
$(document).ready(function(){$("#treemenu").Treeview({speed: "fast",store: true});});
31+
$(document).ready(function(){$("#treemenu").Treeview({speed: "fast",store: true});$("#xooki-" + $(location).attr('pathname').split('/').slice(-1 - ($("#xooki-index a").attr('href').match(/\.\./g) || []).length).join('--').replace(/\.html$/, '') + ' > a').css('color', '#9ebf47')});
3232
hljs.initHighlightingOnLoad();
3333
body
3434
div id="body"

asciidoc/templates/helpers.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def link(printpage)
5959

6060
def relativeRoot()
6161
p = ''
62-
(self.id.split("/").length-1).times do |e|
62+
(self.id.split("/").length - 1).times do |e|
6363
p += '../'
6464
end
6565
return p
@@ -97,7 +97,7 @@ def menu()
9797
def innermenu(page)
9898
m = '<ul id="treemenu" class="treeview">' + "\n"
9999
page.children.each do |p|
100-
m += '<li id="xooki-' + (p.id || "undefined") + '"'
100+
m += '<li id="xooki-' + (p.id.gsub(/\//, '--') || "undefined") + '"'
101101
if p.children.length > 0
102102
m += ' class="submenu"'
103103
end

0 commit comments

Comments
 (0)