3 def menu(input, displayurl)
4 def create_menu(pages, base, displayurl)
7 cururl = page['url'].sub('/index.html', '')
8 if cururl.start_with?(base) and cururl.count('/') == base.count('/')
10 if cururl == displayurl
12 elsif cururl.start_with?(displayurl)
14 elsif displayurl.start_with?(cururl)
20 menu_node = { 'url' => page['url'], 'title' => page['title'], 'class' => css_class }
22 if (css_class == 'parent' or css_class == 'current')
23 sub_nodes = create_menu(pages, cururl + "/", displayurl)
25 menu_node['sub'] = sub_nodes
29 result.push(menu_node)
35 create_menu(input, "", displayurl.sub('/index.html', ''))
40 Liquid::Template.register_filter(Jekyll::MenuFilter)