Skip to content

Instantly share code, notes, and snippets.

@taea taea/_nav.html.haml
Last active Dec 20, 2015

What would you like to do?
middleman で link_to_if っぽいことをやる
-# source/partials/_nav.html.haml
- data.nav.pages.each do |page|
%li{ class: "#{'current' if page_classes ==}" }
= page_classes == ? page.label : (link_to page.label, "#{}.html")
# data/nav.yml
- name: 'index'
label: 'ホーム'
- name: 'concept'
label: 'コンセプト'
- name: 'products'
label: '製品情報'
- name: 'contact'
label: 'お問い合わせ'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.