1. Andriy Kornatskyy
  2. wheezy.web

Commits

Andriy Kornatskyy  committed a92c1ed

Refactored menu-header to use preprocessor.

  • Participants
  • Parent commits c274b57
  • Branches default

Comments (0)

Files changed (1)

File demos/template/content/templates-wheezy/preprocessor/shared/snippet/menu-header.html

View file
+#require(path_for)
+@require(route_args)
+
+#def link(href, title):
+    <a href="#path_for(href)">#title</a></li>\
+#end
+
+@def active_item(route_name):
+    @# ignore
+    @if route_name == route_args.route_name:
+        <li class="active"> \
+    @else:
+        <li> \
+    @end
+@end
+
+<ul id="menu">
+    @active_item('home')#link('home', 'Home')
+    @active_item('about')#link('about', 'About')
+</ul>